Ringdroid是我用来编辑音乐的第三方应用。我的问题并不是关于ringdroid的。 Ringdroid在某些Android设备上崩溃了,我在下面提供了堆栈跟踪。我的问题是当我使用startActivity(...)在Android中启动它时,我怎么能从第三方应用程序中捕获异常?
java.lang.RuntimeException: Unable to resume activity {org.jefferyemanuel.waitingtones/com.ringdroid.RingdroidSelectActivity}: android.database.StaleDataException: Attempted to access a cursor after it has been closed.
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2742)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2771)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1276)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.StaleDataException: Attempted to access a cursor after it has been closed.
at android.database.BulkCursorToCursorAdaptor.throwIfCursorIsClosed(BulkCursorToCursorAdaptor.java:64)
at android.database.BulkCursorToCursorAdaptor.requery(BulkCursorToCursorAdaptor.java:133)
at android.database.CursorWrapper.requery(CursorWrapper.java:186)
at android.app.Activity.performRestart(Activity.java:5157)
at android.app.Activity.performResume(Activity.java:5183)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2732)
... 10 more