hi,
I am developing an application in cocos2d-x that needs the gallery. In version 2.1, the application works perfectly but if running in version Android 3.2 (honeycomb), when selecting a photo of gallery for the second time, throws me this error:
FATAL EXCEPTION: main
E/AndroidRuntime(23714): java.lang.RuntimeException: Unable to resume activity
{com.company.application/com.company.application.class}: java.lang.IllegalStateException:
trying to requery an already closed cursor android.content.ContentResolver$CursorWrapperInner@4081bfd0
E/AndroidRuntime(23714): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2288)
E/AndroidRuntime(23714): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2316)
E/AndroidRuntime(23714): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1050)
E/AndroidRuntime(23714): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(23714): at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime(23714): at android.app.ActivityThread.main(ActivityThread.java:4123)
E/AndroidRuntime(23714): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(23714): at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime(23714): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
E/AndroidRuntime(23714): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/AndroidRuntime(23714): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(23714): Caused by: java.lang.IllegalStateException:
trying to requery an already closed cursor android.content.ContentResolver$CursorWrapperInner@4081bfd0
E/AndroidRuntime(23714): at android.app.Activity.performRestart(Activity.java:4438)
E/AndroidRuntime(23714): at android.app.Activity.performResume(Activity.java:4460)
E/AndroidRuntime(23714): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2278)
i’m not yet tested in version 4.01 (Android) in debug mode, but it happens exactly the same thing, the application crash. What I see is that just open the gallery and select a picture, for the second time, that the problem happens even if the method “onActivityResult” do nothing inside.
From what I see in the report, the application is trying to access a cursor that is already closed.
Someone can help me with this problem?