I searched high and low to find the answer to the question why our application crashes when the user clicks on one item on the context menu and then clicks on another. Here is the stack trace that is found on all Android inner classes:
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): FATAL EXCEPTION: main
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(16908808, class com.android.internal.app.AlertController$RecycleListView) with Adapter(class com.android.internal.view.menu.MenuBuilder$MenuAdapter)]
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.widget.ListView.layoutChildren(ListView.java:1550)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.widget.AbsListView.onTouchEvent(AbsListView.java:2192)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.widget.ListView.onTouchEvent(ListView.java:3377)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.view.View.dispatchTouchEvent(View.java:3766)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1720)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1117)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.app.Dialog.dispatchTouchEvent(Dialog.java:642)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1704)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.view.ViewRoot.handleMessage(ViewRoot.java:1794)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.os.Handler.dispatchMessage(Handler.java:99)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.os.Looper.loop(Looper.java:143)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at android.app.ActivityThread.main(ActivityThread.java:4701)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at java.lang.reflect.Method.invokeNative(Native Method)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at java.lang.reflect.Method.invoke(Method.java:521)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): at dalvik.system.NativeStart.main(Native Method)
11-11 15:08:30.912: WARN/ActivityManager(1261): Force finishing activity com.pyxismobile.pyxWholesaler.ui.activity/.GNBActivity
11-11 15:08:30.943: WARN/WindowManager(1261): No window to dispatch pointer action 1
11-11 15:08:30.943: WARN/WindowManager(1261): No window to dispatch pointer action 0
11-11 15:08:30.943: WARN/WindowManager(1261): No window to dispatch pointer action 1
, , Activity, onCreateContextMenu onContextMenuItem. MyMenuItems, . OnContextMenuItem MenuItem, , .
, , . . , . .
, . Android, , - , .
- , , .
: , . , . - - .