Note that there are some explanatory texts on larger screens.

plurals
  1. POmapview casting exception bug?
    primarykey
    data
    text
    <p>I have added a mapview to my xml layout with a node like so: contained inside a frame</p> <pre><code>&lt;fragment android:id="@+id/map" android:layout_width="100dip" android:layout_height="100dip" android:name="com.google.android.gms.maps.MapFragment"/&gt; </code></pre> <p>In my activity i have referenced it in the onCreate like so:</p> <pre><code> map = (MapView) findViewById(R.id.map); </code></pre> <p>with map defined in globally as MapView map;</p> <pre><code>06-02 14:51:12.357: E/AndroidRuntime(32368): FATAL EXCEPTION: main 06-02 14:51:12.357: E/AndroidRuntime(32368): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.KingNozzle/com.KingNozzle.KNAugmentedRealityActivity}: java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to com.google.android.gms.maps.MapView 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059) 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.app.ActivityThread.access$600(ActivityThread.java:130) 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.os.Handler.dispatchMessage(Handler.java:99) 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.os.Looper.loop(Looper.java:137) 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.app.ActivityThread.main(ActivityThread.java:4745) 06-02 14:51:12.357: E/AndroidRuntime(32368): at java.lang.reflect.Method.invokeNative(Native Method) 06-02 14:51:12.357: E/AndroidRuntime(32368): at java.lang.reflect.Method.invoke(Method.java:511) 06-02 14:51:12.357: E/AndroidRuntime(32368): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 06-02 14:51:12.357: E/AndroidRuntime(32368): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 06-02 14:51:12.357: E/AndroidRuntime(32368): at dalvik.system.NativeStart.main(Native Method) 06-02 14:51:12.357: E/AndroidRuntime(32368): Caused by: java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to com.google.android.gms.maps.MapView 06-02 14:51:12.357: E/AndroidRuntime(32368): at com.KingNozzle.KNAugmentedRealityActivity.onCreate(KNAugmentedRealityActivity.java:129) 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.app.Activity.performCreate(Activity.java:5008) 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 06-02 14:51:12.357: E/AndroidRuntime(32368): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 06-02 14:51:12.357: E/AndroidRuntime(32368): ... 11 more </code></pre> <p>my whole layout looks like so:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" &gt; &lt;FrameLayout android:id="@+id/arFrame" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" &gt; &lt;/FrameLayout&gt; &lt;TextView android:id="@+id/textViewLocation" android:layout_width="fill_parent" android:layout_height="20dp" android:text="no signal" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; &lt;fragment android:id="@+id/map" android:layout_width="100dip" android:layout_height="100dip" android:name="com.google.android.gms.maps.MapFragment"&gt; &lt;/fragment&gt; &lt;com.KingNozzle.Views.KNMultiDirectionalSlidingDrawer xmlns:my="http://schemas.android.com/apk/res/com.KingNozzle" android:id="@+id/drawer" my:direction="topToBottom" android:layout_width="fill_parent" android:layout_height="wrap_content" my:handle="@+id/handle" my:content="@+id/content"&gt; &lt;include android:id="@id/content" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/empty_rel" /&gt; &lt;ImageView android:id="@id/handle" android:layout_width="wrap_content" android:layout_height="40px" android:src="@drawable/sliding_drawer_handle_bottom" /&gt; &lt;/com.KingNozzle.Views.KNMultiDirectionalSlidingDrawer&gt; &lt;/RelativeLayout&gt; </code></pre> <p>cant seem to find out why it thinks its a frame view</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload