I am writing an app which works fine. There are a lot of activities. Every activity runs in landscape mode. Now suppose that user is seeing an activity and he presses device's power button, now the device is in sleep mode.
But when he again presses the power button the device wakes up, now my app should continue from where user left it but my app just closes down without even a force close message, means user suddenly comes to Home Screen.
In logcat it shows the following error -
01-31 12:22:40.010: E/AndroidRuntime(10591): FATAL EXCEPTION: main
01-31 12:22:40.010: E/AndroidRuntime(10591): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.reflexapp/com.example.reflexapp.Login}: android.content.res.Resources$NotFoundException: Resource ID #0x7f030023
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.app.ActivityThread.access$700(ActivityThread.java:150)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.os.Handler.dispatchMessage(Handler.java:99)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.os.Looper.loop(Looper.java:137)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.app.ActivityThread.main(ActivityThread.java:5283)
01-31 12:22:40.010: E/AndroidRuntime(10591): at java.lang.reflect.Method.invokeNative(Native Method)
01-31 12:22:40.010: E/AndroidRuntime(10591): at java.lang.reflect.Method.invoke(Method.java:511)
01-31 12:22:40.010: E/AndroidRuntime(10591): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
01-31 12:22:40.010: E/AndroidRuntime(10591): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
01-31 12:22:40.010: E/AndroidRuntime(10591): at dalvik.system.NativeStart.main(Native Method)
01-31 12:22:40.010: E/AndroidRuntime(10591): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030023
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.content.res.Resources.getValue(Resources.java:1883)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.content.res.Resources.loadXmlResourceParser(Resources.java:3028)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.content.res.Resources.getLayout(Resources.java:1722)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.view.LayoutInflater.inflate(LayoutInflater.java:395)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
01-31 12:22:40.010: E/AndroidRuntime(10591): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:364)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.app.Activity.setContentView(Activity.java:1930)
01-31 12:22:40.010: E/AndroidRuntime(10591): at com.example.reflexapp.Login.onCreate(Login.java:18)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.app.Activity.performCreate(Activity.java:5283)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
01-31 12:22:40.010: E/AndroidRuntime(10591): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
01-31 12:22:40.010: E/AndroidRuntime(10591): ... 11 more
I don't understand what I am doing wrong here. In each activity I am doing like this -
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.userlogin);
init();
}
Please help me out. Thanks in advance.
I solved my problem. I was making a mistake, as my app was meant to work only in landscape mode I was putting all my layout xml files in layout-land folder. There was nothing in layout folder.
But it turned out when device is put to sleep android system tries to bring everything in portrait mode, so it looks for portrait xmls in layout folder but gets nothing. Hence it gives Resource not found exception and app exits.
So mental note, even though your app will show only landscape layouts , you must provide portrait xmls in the layout folder. :-)
I also had this problem when my Activity was crashing when I pressed the Home or Back button keys. I didn't have the files in the "layout" folder because they were only in the "layout-land" folder. I simply copied my files from "layout-land" to "layout" and now the activity doesn't crash when hit the Home key or Back key. This was a bit frustrating at first but everything seems to work fine now.
Related
My application normally working fine without any crashes. In some case(Don't know the scenario) my application crash. The logcat shows the error Resources$NotFoundException . This resource is the:
setContentView(R.layout.practise_menu);
Have any idea about this scenario? When it is possible to crash like this?
My Logcat error is
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.x.y/com.x.y}: android.content.res.Resources$NotFoundException: Resource ID #0x7f030032
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
at android.app.ActivityThread.access$600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030032
at android.content.res.Resources.getValue(Resources.java:1026)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2131)
at android.content.res.Resources.getLayout(Resources.java:865)
at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:306)
at android.app.Activity.setContentView(Activity.java:1912)
at com.x.y.onCreate(Practitioner_menu.java:749)
at android.app.Activity.performCreate(Activity.java:5163)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
at android.app.ActivityThread.access$600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(NativeStart.java)
I got this error report from crashlytics. Please help me to find out.
there is issue of the layout resolution,i have faced these kind of issue many times, better create folder structure as given bellow
layout-large
layout-small
layout-medium
I found the issue:
I just created different folders for landscape and portrait
e.g ->
layout-land
layout-port
But in Androidmanifest file i set the orientation as landscape.
Once i call intent for this activity and press power button and rotate the screen app crash and got this exception.
I don't know what is happening but i guess when the screen rotating it searches the xml file in layout-land and layout-port.
I added a class to my working app. I want the new class to be the first page to load, its called dashboard.class. I added it to the manifest and now the app force closes when you try to load it. I also went and removed the entry in the manifest and the app worked again. Please tell me what I am doing wrong
<activity
android:name="com.magicbuddy.gamble.Dashboard"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.magicbuddy.gamble.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.MagicBuddy.Gamble.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
The dashboard is the new class I added. When I remove it and reset MainActivity to LAUNCHER and MAIN, the app will work just fine again.
I tried the posted solutions of removing the intent-filter and it is still crashing. Here is the logcat **Also thank you guys for your replys
01-31 13:56:38.709: D/AndroidRuntime(1995): Shutting down VM
01-31 13:56:38.709: W/dalvikvm(1995): threadid=1: thread exiting with uncaught exception (group=0xb2eda288)
01-31 13:56:38.709: E/AndroidRuntime(1995): FATAL EXCEPTION: main
01-31 13:56:38.709: E/AndroidRuntime(1995): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.magicbuddy.gamble/com.magicbuddy.gamble.Dashboard}: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.app.ActivityThread.access$600(ActivityThread.java:130)
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.os.Handler.dispatchMessage(Handler.java:99)
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.os.Looper.loop(Looper.java:137)
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.app.ActivityThread.main(ActivityThread.java:4745)
01-31 13:56:38.709: E/AndroidRuntime(1995): at java.lang.reflect.Method.invokeNative(Native Method)
01-31 13:56:38.709: E/AndroidRuntime(1995): at java.lang.reflect.Method.invoke(Method.java:511)
01-31 13:56:38.709: E/AndroidRuntime(1995): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
01-31 13:56:38.709: E/AndroidRuntime(1995): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-31 13:56:38.709: E/AndroidRuntime(1995): at dalvik.system.NativeStart.main(Native Method)
01-31 13:56:38.709: E/AndroidRuntime(1995): Caused by: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
01-31 13:56:38.709: E/AndroidRuntime(1995): at com.magicbuddy.gamble.Dashboard.onCreate(Dashboard.java:25)
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.app.Activity.performCreate(Activity.java:5008)
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
01-31 13:56:38.709: E/AndroidRuntime(1995): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
I added a class that has only 4 buttons on it and each button has an image. That is what I want to load first but this is the logcat error when I try to make that happen
According to the logcat the Exception is:
java.lang.ClassCastException: android.widget.ImageButton cannot be
cast to android.widget.Button
This is happening in the onCreate() method of your Dashboard Activity. You are casting an ImageButton to a Button. The problem is not in the manifest but in the class itself.
Try removing the intent-filter from your MainActivity. You really only need to define intent filters when trying to control what types of intents access into your activity, but if that is only going to be called upon by your Dashboard activity as I think it is, then you don't need to include the intent filter as it is part of the same package
I have a problem with my app. I searched for a solution on stackoverflow, but i didn't find one.
I'm still a beginner in developing android apps. I created my first app on my own in the last week.
The problem: When I start the app everything works fine. Also when I start my app, go to menu and resume immediately, but when i switch to menu, clean my memory and then restart my app, it seems, that the app was still running, because it crashes now. I have a similar effect when I start the app, switch to some other apps and then return to my app. In this case, the app also crashes.
So, why the app is still running, altough I cleaned my memory? Should I override onFinish()- or onPause()-method with some basic code I don't know?
And why does the app crash, when i don't use it for a while?
LogCat:
12-18 23:19:06.850: E/AndroidRuntime(25262): FATAL EXCEPTION: main
12-18 23:19:06.850: E/AndroidRuntime(25262): java.lang.NullPointerException
12-18 23:19:06.850: E/AndroidRuntime(25262): at de.dzapps.isoapp.IsoToleranzen.update(IsoToleranzen.java:1293)
12-18 23:19:06.850: E/AndroidRuntime(25262): at de.dzapps.isoapp.IsoToleranzen$4.onItemClick(IsoToleranzen.java:441)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.widget.AdapterView.performItemClick(AdapterView.java:298)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.widget.AbsListView.performItemClick(AbsListView.java:1283)
12-18 23:19:06.850: E/AndroidRuntime(25262): at de.dzapps.isoapp.IsoToleranzen$1.onGlobalLayout(IsoToleranzen.java:174)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:682)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1875)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1131)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4611)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.view.Choreographer.doFrame(Choreographer.java:525)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.os.Handler.handleCallback(Handler.java:615)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.os.Handler.dispatchMessage(Handler.java:92)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.os.Looper.loop(Looper.java:137)
12-18 23:19:06.850: E/AndroidRuntime(25262): at android.app.ActivityThread.main(ActivityThread.java:4898)
12-18 23:19:06.850: E/AndroidRuntime(25262): at java.lang.reflect.Method.invokeNative(Native Method)
12-18 23:19:06.850: E/AndroidRuntime(25262): at java.lang.reflect.Method.invoke(Method.java:511)
12-18 23:19:06.850: E/AndroidRuntime(25262): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
12-18 23:19:06.850: E/AndroidRuntime(25262): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
12-18 23:19:06.850: E/AndroidRuntime(25262): at dalvik.system.NativeStart.main(Native Method)
Since I get a NullPointerException, it seems, that the system deletes the variables...
But when I doubleclick the third line, eclipse marks this line:
int am_offset = list.getChildAt(0).getTop();
I can't explain this behaviour, because I set a breakpoint at this line and the system never call this expression when I resume the app. list is a ListView.
How can I prevent, that the system deletes the variables, when then app is not used for a while?
Can somebody help me?
Many thanks!
From what I've read, the system deleting variables should be more or less left alone as the system does what it must to keep device performance. It may help to avoid these NullPointerExceptions and restore state by writing safety checks in the onResume of the activity to recreate any lost variables. Also, if they hold data that must persist for long periods of time, SharedPreferences may be of some use for small values and an SQLiteDatabase for when there's a lot to save.
ok I have a solution. I replaced int am_offset = list.getChildAt(0).getTop(); with:
View am_top = list.getChildAt(0);
am_offset = (am_top == null) ? 0 : am_top.getTop();
Now I don't get an exception anymore.
But can somebody explain to me, why the system throws an exception, altough int am_offset = list.getChildAt(0).getTop(); is never called while resuming?
Many thanks!
I've made my Android app tablet optimized and I followed the tutorial here:
Everything is great, but I am trying to select an item (say, the 1st item) with a button in the ActionBar.
I tried this answer to use performItemClick but on I've got error reports of java.lang.IllegalStateException
in android.support.v4.app.ListFragment.ensureList, java.lang.IllegalStateException: Content view not yet created, and java.lang.NullPointerException
in android.content.ComponentName.<init>
I've tried checking if the ListView is null and still get the error reports on the Play Store. How do I properly select an item in my list programmatically?
Update to add logcat and the code is virtually identical to the tutorials in the links:
Logcat A:
java.lang.IllegalStateException: Content view not yet created
at android.support.v4.app.ListFragment.ensureList(ListFragment.java:328)
at android.support.v4.app.ListFragment.getListView(ListFragment.java:222)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:69)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1280)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2606)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1045)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:592)
at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:149)
at android.view.View.performClick(View.java:4222)
at android.view.View$PerformClick.run(View.java:17273)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Logcat B:
java.lang.NullPointerException
at android.content.ComponentName.<init>(ComponentName.java:75)
at android.content.Intent.<init>(Intent.java:2874)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:86)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:284)
at android.widget.ListView.performItemClick(ListView.java:3701)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2205)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:779)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:861)
at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)
at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
at android.view.View$PerformClick.run(View.java:9152)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Update 2
And here is the code that is causing the problem:
if (mListFragment.listView != null) {
mListFragment.listView.performItemClick(mListFragment.listView.getAdapter().getView(position, null, null), position, mListFragment.listView.getAdapter().getItemId(position));
}
i want to open a map when i click a button but unfortunately my app forces down...this is my logcat:
01-31 18:11:49.465: VERBOSE/InputDevice(2836): ID[0]=0(0) Up(1=>0)
01-31 18:11:49.606: WARN/dalvikvm(6111): Class resolved by unexpected DEX: Lkostas/menu/olympiakos/GoogleMaps;(0x486356d8):0x22f5d8 ref [Lcom/google/android/maps/MapActivity;] Lcom/google/android/maps/MapActivity;(0x486356d8):0x21dca0
01-31 18:11:49.606: WARN/dalvikvm(6111): (Lkostas/menu/olympiakos/GoogleMaps; had used a different Lcom/google/android/maps/MapActivity; during pre-verification)
01-31 18:11:49.606: WARN/dalvikvm(6111): Unable to resolve superclass of Lkostas/menu/olympiakos/GoogleMaps; (67)
01-31 18:11:49.606: WARN/dalvikvm(6111): Link of class 'Lkostas/menu/olympiakos/GoogleMaps;' failed
01-31 18:11:49.610: DEBUG/AndroidRuntime(6111): Shutting down VM
01-31 18:11:49.610: WARN/dalvikvm(6111): threadid=1: thread exiting with uncaught exception (group=0x4001d7d0)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): FATAL EXCEPTION: main
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): java.lang.NoClassDefFoundError: kostas.menu.olympiakos.GoogleMaps
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at kostas.menu.olympiakos.DialogActivity$1.onItemClick(DialogActivity.java:47)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at android.widget.ListView.performItemClick(ListView.java:3672)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at android.os.Handler.handleCallback(Handler.java:587)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at android.os.Handler.dispatchMessage(Handler.java:92)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at android.os.Looper.loop(Looper.java:123)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at java.lang.reflect.Method.invokeNative(Native Method)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at java.lang.reflect.Method.invoke(Method.java:521)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at dalvik.system.NativeStart.main(Native Method)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): Caused by: java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at dalvik.system.DexFile.defineClass(Native Method)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
01-31 18:11:49.641: ERROR/AndroidRuntime(6111): ... 13 more
01-31 18:11:49.660: WARN/ActivityManager(2836): Force finishing activity kostas.menu.olympiakos/.DialogActivity
thats the way i m calling the map activity:
Intent newActivity111 = new Intent(DialogActivity.this, GoogleMaps.class);
startActivity(newActivity111);
Somehow, your device or emulator has a different implementation of com.google.android.maps.MapActivity than what your compiler used. That should not be possible under normal circumstances. It suggests that you have seriously messed up your build process, such as manually adding the Maps add-on JAR to your build path rather than just setting a Maps-enabled target.
Not too sure whether your problem is related to the libraries available.
Map library is not part of the Standard Android library. Hence you need to declare it in the Manifest file.
Follow the link: http://developer.android.com/resources/tutorials/views/hello-mapview.html
Since the library is not available your Activity "GoogleMaps" which extends MapActivity doesn't get loaded into the system.
All the questions and answers related to getting the Fatal Exception java.lang.NoClassDefFoundError when using a MapActivity did not help me. CommonsWare's response gave me a hint that helped me arrive at my solution.
When I copied my project to a new environment, my setup did not include the Google Maps library. I added the maps.jar file manually into my project and was able to link the application successfully but when I attempted to start the activity that derived from MapActivity I got the fatal exception.
I removed the reference to the maps.jar library. I then noticed I was building against the Android 2.2 SDK. I did not have the Google APIs SDK installed. After downloading and installing the Google APIs SDK, and specifying this SDK as my target, my problem went away.