I have one application. I need to display map view when we click on button. Actually this button is in one class and google map is in another class. Now when i click on that button , In android Emulator it displays message android application stopped unexpectedly.
-
posting some code would be helpful. But why cant you just launch the second activity (map activity) when you click on the button in the 1st activity? Should be fairly easy. – Urban Sep 28 '11 at 08:25
-
Posting the exception stack shown in Logcat would also be helpful. Might be ClassNotFoundException or something we can hardly think of. – Aloong Sep 28 '11 at 09:19
-
09-28 14:51:27.214: ERROR/AndroidRuntime(323): java.lang.NoClassDefFoundError: com.popcornapps.moviecorn.Example Example is my present activity when i extending this activity to MapActivtiy its show error in Intent i = new intent(Example.this,Map.class) Line – sravanthi Sep 28 '11 at 09:28
4 Answers
Posting some code will help. Make sure you have extended the second activity as MapActivity. Also, the emulator must be google-maps emulator and not the normal ones. Depending on your SDK, create the new AVD and choose GoogleMaps API. I think that should solve the problem

- 1,787
- 2
- 18
- 34
-
i am extending one activity to mapActivity,i am using google maps emulator but still i am getting application stopped unexpectedly. – sravanthi Sep 28 '11 at 08:59
-
Have you added both the activities in the AndroidManifest xml file? if you tend to miss adding the activities in manifest, it will throw this error – Rashmi.B Sep 28 '11 at 10:18
Make sure you have put
<uses-library android:name="com.google.android.maps" />
in your AndroidManfiest file

- 6,846
- 9
- 64
- 87
These examples may help you to understand why you are getting the error msg ,and both are doing same (call one map activity class from another...)
http://eagle.phys.utk.edu/guidry/android/mappingDemo.html
http://eagle.phys.utk.edu/guidry/android/mapOverlayDemo.html
Donot forget to add your map activity in the manifest.xml :

- 7,742
- 11
- 47
- 71
-
In my application i have many Actitvitys when i extending one activity to other activity its going forward,But when i extenting activity to MapActivity its showing error in – sravanthi Sep 28 '11 at 09:25
-
-
For the above intent try using Intent i = new Intent(getApplicationContext(),map.class); startActivity(i); – Rashmi.B Sep 28 '11 at 10:19
Like @Nipuna Silva said , add a
<uses-library android:name="com.google.android.maps" />
in your AndroidManfiest.xml. Inside the<application>
node.Try
Project->clean
in your Eclipse to rebuild your project.- Answers in this question May help you.