Android.Views.WindowManagerBadTokenException: Unable to add window -- token android.os.BinderProxy@

1,错误分析:

此问题根本原因是由于将要弹出的ddialog或Toast所要依附的View已经不存在导致的。

解决方案: 在当前的页面添加一个静态变量  static Context context;

创建 AlertDialog.Builder builder = new AlertDialog.Builder(context);

传入静态context

友情链接:http://www.aiuxian.com/article/p-383550.html

相关文章:

  • 2021-03-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2021-12-26
  • 2021-08-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-07-21
相关资源
相似解决方案