解决方法 在光标超出范围之前,您需要在光标上显式调用close.如果你不这样做,游标的内容,所以它的分配资源将不会被释放,直到垃圾收集器决定实际删除它. 由于光标需要大量资源,所以一旦不再使用它就立即关闭它. 总结03-02 04:23:07.015: E/StrictMode(1096): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoIDing resource leaks.
03-02 04:23:07.015: E/StrictMode(1096): java.lang.Throwable: Explicit termination method ‘close’ not called
03-02 04:23:07.015: E/StrictMode(1096): at dalvik.system.CloseGuard.open(CloseGuard.java:184)
03-02 04:23:07.015: E/StrictMode(1096): at androID.database.sqlite.sqliteDatabase.openInner(sqliteDatabase.java:805)
03-02 04:23:07.015: E/StrictMode(1096): at androID.database.sqlite.sqliteDatabase.open(sqliteDatabase.java:789)
03-02 04:23:07.015: E/StrictMode(1096): at androID.database.sqlite.sqliteDatabase.openDatabase(sqliteDatabase.java:694)
03-02 04:23:07.015: E/StrictMode(1096): at androID.app.ContextImpl.openorCreateDatabase(ContextImpl.java:944)
03-02 04:23:07.015: E/StrictMode(1096): at androID.database.sqlite.sqliteOpenHelper.getDatabaseLocked(sqliteOpenHelper.java:224)
03-02 04:23:07.015: E/StrictMode(1096): at androID.database.sqlite.sqliteOpenHelper.getReadableDatabase(sqliteOpenHelper.java:188)
03-02 04:23:07.015: E/StrictMode(1096): at com.helper.database.DBOperator.queryFeeds(DBOperator.java:53)
03-02 04:23:07.015: E/StrictMode(1096): at com.example.RSSreader.MainActivitySpace.getFeeddata(MainActivitySpace.java:85)
03-02 04:23:07.015: E/StrictMode(1096): at com.example.RSSreader.MainActivitySpace.onActivityCreated(MainActivitySpace.java:74)
03-02 04:23:07.015: E/StrictMode(1096): at androID.support.v4.app.Fragment.performActivityCreated(Fragment.java:1508)
03-02 04:23:07.015: E/StrictMode(1096): at androID.support.v4.app.FragmentManagerImpl.movetoState(FragmentManager.java:947)
03-02 04:23:07.015: E/StrictMode(1096): at androID.support.v4.app.FragmentManagerImpl.movetoState(FragmentManager.java:1104)
03-02 04:23:07.015: E/StrictMode(1096): at androID.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
03-02 04:23:07.015: E/StrictMode(1096): at androID.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
03-02 04:23:07.015: E/StrictMode(1096): at androID.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:570)
03-02 04:23:07.015: E/StrictMode(1096): at androID.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
03-02 04:23:07.015: E/StrictMode(1096): at androID.app.Activity.performStart(Activity.java:5253)
03-02 04:23:07.015: E/StrictMode(1096): at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2149)
03-02 04:23:07.015: E/StrictMode(1096): at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
03-02 04:23:07.015: E/StrictMode(1096): at androID.app.ActivityThread.access$700(ActivityThread.java:135)
03-02 04:23:07.015: E/StrictMode(1096): at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
03-02 04:23:07.015: E/StrictMode(1096): at androID.os.Handler.dispatchMessage(Handler.java:102)
03-02 04:23:07.015: E/StrictMode(1096): at androID.os.Looper.loop(Looper.java:137)
03-02 04:23:07.015: E/StrictMode(1096): at androID.app.ActivityThread.main(ActivityThread.java:4998)
03-02 04:23:07.015: E/StrictMode(1096): at java.lang.reflect.Method.invokeNative(Native Method)
03-02 04:23:07.015: E/StrictMode(1096): at java.lang.reflect.Method.invoke(Method.java:515)
03-02 04:23:07.015: E/StrictMode(1096): at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
03-02 04:23:07.015: E/StrictMode(1096): at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:593)
03-02 04:23:07.015: E/StrictMode(1096): at dalvik.system.NativeStart.main(Native Method)
以上是内存溢出为你收集整理的android – “显式终止方法’关闭’未被称为”是什么意思?全部内容,希望文章能够帮你解决android – “显式终止方法’关闭’未被称为”是什么意思?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)