开发者

Android OutOfMemoryError Crash in startManagingCursor

I am getting a crash report back that says OutOfMemoryError in my call to startManagingCursor. Here is the returned stack trace:

java.lang.OutOfMemoryError
at java.util.ArrayList.add(ArrayList.java:123)
at android.app.Activity.startManagingCursor(Activity.java:1652)
at com.bubblewaretechnology.pianounlockscreen.LockDetecter.onResume(LockDetecter.java:633)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
at android.app.ActivityThread.performNewIntents(ActivityThread.java:1789)
at android.app.ActivityThread.handleNewIntent(ActivityThread.java:1795)
at android.app.ActivityThread.access$2300(ActivityThread.java:124)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1015)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3806)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.ru开发者_如何学JAVAn(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)

I am very careful to close my cursors, SQLiteDatabase and SQLiteOpenHelper. Here is a short code segment that the crash refers to:

Cursor callCursor = lockLib.getCallState();
startManagingCursor(callCursor);
....
callCursor.close();

Pretty stumped on how to go about troubleshooting this problem. I know startManagingCursor is depreciated but I am not targeting HONEYCOMB or later, so I cant switch to CursorLoader. Does anyone have any suggestions on how to proceed?


I know it's lame to answer your own question but you can remove startManagingCursor, Reference Link, as long as you are managing the lifecycle of your cursor appropriately.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜