user1025050
user1025050

Reputation:

android:exception in map

I am implementing an app in which i have to use google map and code is as follows:

<com.google.android.maps.MapView
     android:id="@+id/mapview1"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:apiKey="0ACHOtlugQlOpv7OWSc2GYfNmJfYY1ltGNlzgEQ"
     android:clickable="true"
     android:enabled="true" >
 </com.google.android.maps.MapView>

and i got this exception:


11-23 12:50:52.796: I/System.out(24625): android.view.InflateException: Binary XML file line #68: Error inflating class com.google.android.maps.Mapview
11-23 12:28:44.445: E/AndroidRuntime(24124):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at android.os.Looper.loop(Looper.java:123)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at android.app.ActivityThread.main(ActivityThread.java:3687)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at java.lang.reflect.Method.invokeNative(Native Method)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at java.lang.reflect.Method.invoke(Method.java:507)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at dalvik.system.NativeStart.main(Native Method)
11-23 12:28:44.445: E/AndroidRuntime(24124): Caused by: java.lang.NullPointerException
11-23 12:28:44.445: E/AndroidRuntime(24124):    at com.trigma.mcs.Outsubmap.onCreate(Outsubmap.java:23)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-23 12:28:44.445: E/AndroidRuntime(24124):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)

Upvotes: -1

Views: 107

Answers (2)

user1025050
user1025050

Reputation:

This was due to mapActivity. Actully i forgot to extend mapactivity and by extending that my code worked.

Upvotes: 2

abhinav
abhinav

Reputation: 3217

Did you specify the shared library in manifest file?

<uses-library android:name="com.google.android.maps" />

More info

Upvotes: 3

Related Questions