bug--Unable to add window –token is not valid; is your activity running?

简介: 错误原因是Dialog在show的时候必须要有一个activity作为窗口载体,上面的日志的意思是承载Dialog的activity已经被销毁了,不存在了解决方法:1.粗暴一点直接try catch2.

错误原因是Dialog在show的时候必须要有一个activity作为窗口载体,上面的日志的意思是承载Dialog的activity已经被销毁了,不存在了

解决方法:
1.粗暴一点直接try catch
2.有好一点就是show之前判断activity是否被销毁了
if (!isFinishing()){
showDialog()
};

相关文章
Flutter之运行提示Could not update files on device: Connection closed before full header was received
Flutter之运行提示Could not update files on device: Connection closed before full header was received
679 0
|
2月前
|
Kubernetes 容器
使用kubeadm部署k8s报错:The kubelet is not running或者level=error msg="Handler for POST /v1.43/images/create returned error: Head \"https://us-west2-dock
使用kubeadm部署k8s报错:The kubelet is not running或者level=error msg="Handler for POST /v1.43/images/create returned error: Head \"https://us-west2-dock
|
4月前
|
JavaScript
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
60 0
|
Java Spring
Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings解决办法
Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings解决办法
1986 1
Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings解决办法
|
网络安全 开发工具
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
782 0
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
Unable to add window --token is not valid
Unable to add window --token is not valid
my Note debug - add to function
Created by Wang, Jerry, last modified on Feb 03, 2015
103 0
my Note debug - add to function
How to find root cause of creation navigation failure
Created by Jerry Wang, last modified on Dec 09, 2014
How to find root cause of creation navigation failure
|
网络协议 Java 容器
【报错】项目启动,仅仅报错 One or more listeners failed to start. Full details will be found in the appropriate container log file
今天spring4.3.13 项目,整合ActiveMQ的时候,项目启动在自动部署到tomcat下的时候,不能正常的部署,仅仅报错如下: Connected to server [2017-12-08 03:57:12,428] Artifact springDemo:war exploded: Artifact is being deployed, please wait.
6163 0