错误:BinderProxy @ 45d459c0无效;在您的活动运行? [英] Error : BinderProxy@45d459c0 is not valid; is your activity running?

查看:164
本文介绍了错误:BinderProxy @ 45d459c0无效;在您的活动运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么错误...我还没有找到详细的关于在计算器社区这个错误任何讨论: -

  10-18 23:53:11.613:ERROR / AndroidRuntime(3197):未捕获的处理程序:螺纹主力退出,由于未捕获的异常
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):android.view.WindowManager $ BadTokenException:无法添加窗口 - 令牌android.os.BinderProxy@45d459c0无效;在您的活动运行?
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.view.ViewRoot.setView(ViewRoot.java:468)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.view.Window $ LocalWindowManager.addView(Window.java:424)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.app.Dialog.show(Dialog.java:239)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在com.vishal.contacte.Locationlistener $ MyLocationListener.onLocationChanged(Locationlistener.java:86)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.location.LocationManager $ ListenerTransport._handleMessage(LocationManager.java:179)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.location.LocationManager $ ListenerTransport.access $ 000(LocationManager.java:112)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.location.LocationManager $ ListenerTransport $ 1.handleMessage(LocationManager.java:128)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.os.Handler.dispatchMessage(Handler.java:99)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.os.Looper.loop(Looper.java:123)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在android.app.ActivityThread.main(ActivityThread.java:4363)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在java.lang.reflect.Method.invokeNative(本机方法)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在java.lang.reflect.Method.invoke(Method.java:521)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:862)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
10-18 23:53:11.658:ERROR / AndroidRuntime(3197):在dalvik.system.NativeStart.main(本机方法)
 

解决方案

我看到这个错误从我的一些应用程序一段时间曾经报道活动时调用的对话框中完成出于某种原因或其他,当它试图表明的对话框。下面是解决了这个问题对我来说:

 如果(!((活动)范围内).isFinishing())
{
    //显示对话框
}
 

所有其他的答案那里似乎在做奇怪的事情想通过跑步活动列表迭代,但是这是非常简单的,似乎这样的伎俩。

What is this error... i haven't found any discussion on this error in the stackoverflow community Detailed :-

10-18 23:53:11.613: ERROR/AndroidRuntime(3197): Uncaught handler: thread main exiting due to uncaught exception
10-18 23:53:11.658: ERROR/AndroidRuntime(3197): android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@45d459c0 is not valid; is your activity running?
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.view.ViewRoot.setView(ViewRoot.java:468)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.view.Window$LocalWindowManager.addView(Window.java:424)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.app.Dialog.show(Dialog.java:239)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at com.vishal.contacte.Locationlistener$MyLocationListener.onLocationChanged(Locationlistener.java:86)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:179)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:112)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:128)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.os.Looper.loop(Looper.java:123)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at android.app.ActivityThread.main(ActivityThread.java:4363)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at java.lang.reflect.Method.invokeNative(Native Method)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at java.lang.reflect.Method.invoke(Method.java:521)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
10-18 23:53:11.658: ERROR/AndroidRuntime(3197):     at dalvik.system.NativeStart.main(Native Method)

解决方案

I was seeing this error reported once in a while from some of my apps when the activity calling the dialog was finishing for some reason or another when it tried to show a dialog. Here's what solved it for me:

if(!((Activity) context).isFinishing())
{
    //show dialog
}

All the other answers out there seem to be doing weird things like iterating through the list of running activities, but this is much simpler and seems to do the trick.

这篇关于错误:BinderProxy @ 45d459c0无效;在您的活动运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆