- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个登录屏幕,登录成功后,它会完成并显示 AppActivity。如果用户从应用程序注销,则再次显示登录屏幕,完成 AppActivity。但是,当登录屏幕在用户注销后尝试显示对话框时,我遇到了如下所示的错误:
android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@4276c0e8 is not valid; is your activity running?
如果用户成功登录应用程序,LoginScreen 完成,显示 AppActivity:
Intent intent = new Intent(LoginScreen.this, AppActivity.class);
startActivity(intent);
finish();
如果用户点击注销按钮,AppActivity 完成,显示 LoginScreen:
Intent intent = new Intent(AppActivity.this, LoginScreen.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
最佳答案
当您为不再存在的上下文显示对话框时,可能会发生这种情况。常见情况 - 如果“显示对话框”操作在异步操作之后进行,并且在该操作期间原始 Activity (即对话框的父 Activity )被销毁。
这可能类似于 here .希望对您有所帮助。
关于android - 注销对话框错误 : token android. os.BinderProxy@4276c0e8 无效;你的 Activity 在运行吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38298887/
我收到这个 ClassCaseException - /ActivityManager(213): Bad activity token: android.os.BinderProxy@420b43f
我有一个登录屏幕,成功登录后,它完成并显示另一个包含用户信息的页面。 我读到了 this post还有this post . 我也阅读了很多关于我们如何扩展 Application 类的内容,但我仍然
我一直在尝试让这个 android 服务正常工作,但我不明白为什么会出现这个错误。 05-13 12:13:36.203: ERROR/dalvikvm(7782): could not disabl
谷歌登录不工作。它给出了错误: platformException sign_in_failed. 我确保我列出了所有依赖项和 google-services json 文件,但错误仍然存在。 i
这是什么错误...我在stackoverflow社区中没有找到任何关于这个错误的讨论详细:- 10-18 23:53:11.613: ERROR/AndroidRuntime(3197): Uncau
我的应用程序有一个带有底部导航和多个 fragment 的 Activity ,我正在使用导航组件。 在我的设置 fragment 中,我有一个 ListPreference,用户可以在其中切换明暗模
我有一个 Activity Main Activity 有一个 web View ,我想在广播接收器接收消息时加载 web View ,还有一个服务类将数据传递给 Activity web View
每次声明和运行两个服务时,我都会遇到以下 binder.proxy 异常。一项服务在不同的进程(对应用程序私有(private))中运行,而另一项服务在与我的应用程序在(默认应用程序进程)中运行的相同
我正在开发一个小型应用程序,该应用程序已经过测试并且一直运行良好。当我添加新代码让应用程序将信息发送到我的 Firebase 实时数据库时,它只是不会启动我的应用程序。它会使 MainActivity
我有一个 Service,我正试图将其绑定(bind)到我的主要 Activity,但我收到了一个 java.lang.ClassCastException: android.os.BinderPro
我正在实现一个服务,并在该服务之上有一个包装类,该类在本地绑定(bind)到它。现在,当我将服务导出为 jar 并从另一个应用程序链接到它时(此应用程序实例化包装类)。当我运行应用程序时,我收到 Cl
尝试使用 kotlin 构建一个 android 应用程序,我在其中连接、发送和读取来自 BLE(蓝牙低功耗)设备的数据。我设计了一个 Activity ,它将向我显示连接统计信息和从 BLE 设备接
我尝试通过 Facebook API 连接到 Facebook,我遵循以下示例:https://github.com/facebook/facebook-android-sdk/tree/master
我尝试使用 twitter4j 连接到 Twitter。但它显示了标题所说的错误。 protected void onCreate(Bundle savedInstanceState) { s
我只在应用程序启动时并且仅在模拟器和调试中崩溃 模拟器&运行:OK 设备&运行:OK 设备和调试:OK 模拟器和调试:崩溃! 看起来 Android 正在尝试在启动时执行 Toast,并且由于我没有很
我尝试通过 Facebook API 连接到 Facebook,我遵循以下示例:https://github.com/facebook/facebook-android-sdk/tree/master
我有一个登录屏幕,登录成功后,它会完成并显示 AppActivity。如果用户从应用程序注销,则再次显示登录屏幕,完成 AppActivity。但是,当登录屏幕在用户注销后尝试显示对话框时,我遇到了如
当我按下按钮更改为另一个 Activity 时,我得到这个:“W/ActivityThread:handleWindowVisibility: token android.os.BinderProxy
我有一个带有 pendingIntent 的短信发送器,一旦发送短信,它就会打开一个对话框。这是来自 SMS 发件人的代码 public final void sendSmsByManager(fin
一位用户昨天向我发送了这份崩溃报告: android.view.WindowManager$BadTokenException: Unable to add window -- token andr
我是一名优秀的程序员,十分优秀!