android – 打开MapActivity时’终结器抛出未捕获的异常’

android – 打开MapActivity时’终结器抛出未捕获的异常’,第1张

概述我的代码中有这些行: // create tab4intent = new Intent(this, ActWhereAmI.class) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);tabspecWhereAmI = tabHost .newTabSpec("tab4") .setIndicator(Ut 我的代码中有这些行:
// create tab4intent = new Intent(this,ActWhereAmI.class)        .addFlags(Intent.FLAG_ACTIVITY_CLEAR_top);tabspecWhereAmI = tabHost        .newTabSpec("tab4")        .setIndicator(UtilitIEs.prepareTabVIEw(this,"where am I"))        .setContent(intent);tabHost.addTab(tabspecWhereAmI);public static VIEw prepareTabVIEw(Context context,String text) {        VIEw vIEw = LayoutInflater.from(context).inflate(                R.layout.tab_indicator,null);        TextVIEw tv = (TextVIEw) vIEw.findVIEwByID(R.ID.tabIndicatorTextVIEw);        tv.setText(text);        return vIEw;    }

当应用程序运行行tabHost.addTab(tabspecWhereAmI)时;我只在LogCat中得到以下错误,程序运行没有任何问题:

10-17 13:38:01.164: W/MapActivity(4815): Recycling dispatcher androID_maps_conflict_avoIDance.com.Google.Googlenav.datarequest.DataRequestdispatcher@413c865810-17 13:38:01.171: V/MapActivity(4815): Recycling map object.10-17 13:38:01.335: W/MapActivity(4815): Recycling dispatcher androID_maps_conflict_avoIDance.com.Google.Googlenav.datarequest.DataRequestdispatcher@413c865810-17 13:38:01.335: V/MapActivity(4815): Recycling map object.10-17 13:38:01.554: D/dalvikvm(4815): GC_CONCURRENT freed 776K,23% free 10286K/13255K,paused 2ms+7ms10-17 13:38:01.554: E/System(4815): Uncaught exception thrown by finalizer10-17 13:38:01.554: E/System(4815): java.lang.IllegalStateException: Binder has been finalized!10-17 13:38:01.554: E/System(4815):     at androID.os.BinderProxy.transact(Native Method)10-17 13:38:01.554: E/System(4815):     at androID.database.BulkCursorProxy.close(BulkCursorNative.java:288)10-17 13:38:01.554: E/System(4815):     at androID.database.BulkCursorToCursorAdaptor.close(BulkCursorToCursorAdaptor.java:133)10-17 13:38:01.554: E/System(4815):     at androID.database.CursorWrapper.close(CursorWrapper.java:49)10-17 13:38:01.554: E/System(4815):     at androID.content.ContentResolver$CursorWrapperInner.close(ContentResolver.java:1591)10-17 13:38:01.554: E/System(4815):     at androID.content.ContentResolver$CursorWrapperInner.finalize(ContentResolver.java:1604)10-17 13:38:01.554: E/System(4815):     at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:182)10-17 13:38:01.554: E/System(4815):     at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)10-17 13:38:01.554: E/System(4815):     at java.lang.Thread.run(Thread.java:856)10-17 13:38:01.554: E/System(4815): Uncaught exception thrown by finalizer10-17 13:38:01.554: E/System(4815): java.lang.IllegalStateException: Binder has been finalized!10-17 13:38:01.554: E/System(4815):     at androID.os.BinderProxy.transact(Native Method)10-17 13:38:01.554: E/System(4815):     at androID.database.BulkCursorProxy.close(BulkCursorNative.java:288)10-17 13:38:01.554: E/System(4815):     at androID.database.BulkCursorToCursorAdaptor.close(BulkCursorToCursorAdaptor.java:133)10-17 13:38:01.554: E/System(4815):     at androID.database.CursorWrapper.close(CursorWrapper.java:49)10-17 13:38:01.554: E/System(4815):     at androID.content.ContentResolver$CursorWrapperInner.close(ContentResolver.java:1591)10-17 13:38:01.554: E/System(4815):     at androID.content.ContentResolver$CursorWrapperInner.finalize(ContentResolver.java:1604)10-17 13:38:01.554: E/System(4815):     at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:182)10-17 13:38:01.554: E/System(4815):     at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)10-17 13:38:01.554: E/System(4815):     at java.lang.Thread.run(Thread.java:856)

异常发生在ActWhereAmI的onCreate(…)方法之前.我的问题类似于这个问题:Uncaught exception thrown by finalizer

为什么我会收到此错误,如何解决?

解决方法 你在做与db有关的事吗?它几乎听起来像正在执行数据库 *** 作的活动已关闭光标(手动或自动)然后尝试在finalize()中执行某些 *** 作,或者 *** 作系统正在关闭光标.

在#2的情况下,这可能意味着您可能必须手动关闭光标.如果是这种情况但是如果您需要打开活动,请考虑在onResume / onPause或onStart / onStart中重新打开/关闭它

其他人提到这可能是因为你试图同时打开其中两个

总结

以上是内存溢出为你收集整理的android – 打开MapActivity时’终结器抛出未捕获的异常’全部内容,希望文章能够帮你解决android – 打开MapActivity时’终结器抛出未捕获的异常’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1136141.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存