boolean android.app.Activity.isFinishing()函数使用
来源:互联网 发布:服务器返回数据错误 编辑:程序博客网 时间:2024/05/20 11:48
这个函数注释:
Check to see whether this activity is in the process of finishing, either because you calledfinish
on it or someone else has requested that it finished. This is often used inonPause
to determine whether the activity is simply pausing or completely finishing.
- Returns:
- If the activity is finishing, returns true; else returns false.
- See Also:
- finish
这次项目中,遇到这个问题,一个activity在finish时候,还有收到广播,结果导致bug
在广播接收器中先判断一下比较保险。或者在onDestroy里面注销广播
{
@Override
public void onReceive(Context context, Intent intent)
{
Log.d(TAG, intent.toString());
final String action = intent.getAction();
if(isFinishing())
{
。。。。。。。
return;}
}
还有遇到一个问题,在activity finish时候,这时候handler.sendMessage,这时候也会导致bug
这时候最好在finish函数里面removeAllCallbackAndMessage(this)
- boolean android.app.Activity.isFinishing()函数使用
- boolean android.app.Activity.isFinishing()函数使用
- boolean android.app.Activity.isFinishing()函数使用
- boolean android.app.Activity.isFinishing()函数使用
- Android Studio——boolean android.app.Activity.isFinishing()函数使用
- Activity isFinishing()函数使用(笔记)
- Activity使用isFinishing
- (Activity)mContext).isFinishing()的作用
- isFinishing ()
- isFinishing ()
- 使用Activity.isfinishing()解决java.lang.IllegalArgumentException: View not attached to window manager
- 使用Activity.isfinishing()解决java.lang.IllegalArgumentException: View not attached to window manager
- JavaH使用问题:无法访问android.app.Activity
- Javah使用问题:无法访问android.app.Activity
- android.app.Activity---中文
- android.app.Activity
- android.app.Activity
- android.app.Activity//
- [Linux driver]解密module_init
- 更改php.ini配置
- HibernateTemplate的常规用法
- 【POJ】1004 Financial Management
- 简单监听器
- boolean android.app.Activity.isFinishing()函数使用
- 解决因为TestNG插件导致eclipse无法跑jtester的问题
- java运算符优先级
- oracle表空间管理
- 上帝叫他灭亡,必先叫他疯狂!又一个独裁专制的开始!
- 使用sp_configure启用 'Ad Hoc Distributed Queries'
- 图片按比例缩小,并压缩保存
- 15条 linux Find 命令实际使用方法
- 解决ubuntu打开网页慢问题