Im getting "unclosed cursor detected" when starting a MapActivity even in the most basic form:
protected void onCreate(Bundle icicle) {
super.onCreate(icicle); // <--- The Exception occurs here
setContentView(R.layout.layout_map);
}
After the exception, the map starts and it works perfectly, but that exception every time it starts the activity really bothers me.
The Exception:
04-04 12:02:22.858: W/Cursor(14122): Unclosed Cursor detected 04-04 12:02:22.866: W/Cursor(14122): at android.content.ContentResolver.query(ContentResolver.java:258) 04-04 12:02:22.866: W/Cursor(14122): at com.google.common.android.AndroidConfig.getSetting(Unknown Source) 04-04 12:02:22.866: W/Cursor(14122): at com.google.common.android.AndroidConfig.getDistributionChannelInternal(Unknown Source) 04-04 12:02:22.866: W/Cursor(14122): at com.google.common.Config.init(Unknown Source) 04-04 12:02:22.866: W/Cursor(14122): at com.google.common.android.AndroidConfig.(Unknown Source) 04-04 12:02:22.866: W/Cursor(14122): at com.google.common.android.AndroidConfig.(Unknown Source) 04-04 12:02:22.866: W/Cursor(14122): at com.google.android.maps.MapActivity.onCreate(MapActivity.java:405) 04-04 12:02:22.866: W/Cursor(14122): at com.myapp.activity.MyMapActivity.onCreate(MyMapActivity.java:25) 04-04 12:02:22.874: W/Cursor(14122): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 04-04 12:02:22.874: W/Cursor(14122): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717) 04-04 12:02:22.874: W/Cursor(14122): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769) 04-04 12:02:22.874: W/Cursor(14122): at android.app.ActivityThread.access$2500(ActivityThread.java:129) 04-04 12:02:22.874: W/Cursor(14122): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2117) 04-04 12:02:22.874: W/Cursor(14122): at android.os.Handler.dispatchMessage(Handler.java:99) 04-04 12:02:22.874: W/Cursor(14122): at android.os.Looper.loop(Looper.java:143) 04-04 12:02:22.874: W/Cursor(14122): at android.app.ActivityThread.main(ActivityThread.java:4717) 04-04 12:02:22.874: W/Cursor(14122): at java.lang.reflect.Method.invokeNative(Native Method) 04-04 12:02:22.882: W/Cursor(14122): at java.lang.reflect.Method.invoke(Method.java:521) 04-04 12:02:22.882: W/Cursor(14122): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 04-04 12:02:22.882: W/Cursor(14122): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 04-04 12:02:22.882: W/Cursor(14122): at dalvik.system.NativeStart.main(Native Method)
I searched the web but found nothing... Extra info:
- Im using Google API 2.2
- Tested it on the device and on the AVD
- Have other Map projects working with Google API 2.1 (Without that exception of course)
- My AndroidManifest is not missing anything (hence the map starts and works after the exception is thrown)
Help is appreciated!
Edit:
I updated both Google API level 7 and 8 (the problem started on 8) now it happens on API level 7 too...
Hydrangea helped me notice that the Bundle variables name in my MapActivity (icicle) differs from the "standard" (savedInstanceState) maybe that has something to do with the problem?