Android 3.2上的一个大BUG Android 3.2存在一个大bug如下: 1. Settings -> Wireless & networks -> Mobile networks -> Access Point Names
2. Press menu on top-right -> New APN
3. “Edit access point” dialog show up
4. Press “Home” button to go home page
5. Do step 1 again.
6. Error message appears
Android 2.3 和Android 4.0 均没有这个bug!!!
02-01 08:28:54.710: ERROR/AndroidRuntime(1640): java.lang.RuntimeException: Unable to resume activity {com.android.settings/com.android.settings.ApnSettings}: java.lang.IllegalStateException: trying to requery an already closed cursor android.content.ContentResolver$CursorWrapperInner@4055d470 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2288) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2316) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1050) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at android.os.Handler.dispatchMessage(Handler.java:99) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at android.os.Looper.loop(Looper.java:132) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at android.app.ActivityThread.main(ActivityThread.java:4123) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at java.lang.reflect.Method.invokeNative(Native Method) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at java.lang.reflect.Method.invoke(Method.java:491) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at dalvik.system.NativeStart.main(Native Method) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): Caused by: java.lang.IllegalStateException: trying to requery an already closed cursor android.content.ContentResolver$CursorWrapperInner@4055d470 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at android.app.Activity.performRestart(Activity.java:4438) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at android.app.Activity.performResume(Activity.java:4460) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2278) 02-01 08:28:54.710: ERROR/AndroidRuntime(1640): ... 10 more 02-01 08:28:54.720: WARN/ActivityManager(244): Force finishing activity com.android.settings/.ApnSettings 02-01 08:28:54.730: WARN/ActivityManager(244): Force finishing activity com.android.phone/.Settings
如果是你的代码中使用了 SQLite 的 query,比如,调用了 Activity 的 managedQuery,那么需要修改成 GetContentResolver().query;这个问题就可以
不清楚为什么需要这样修改,我也是遇到过这样的问题,后来找资料,说是需要这样绕开;
只能说,估计是 managedQuery 内部可能为了保存 cursor 的那部分的实现很特别,在 android 3.x 上一定会出现这个问题
|