我可以杀死或完成()的活动的主题不是UI线程等..? [英] can i kill or finish() an Activity in a Thread other than UI thread..?

查看:87
本文介绍了我可以杀死或完成()的活动的主题不是UI线程等..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想,如果它可以创建一个线程,并杀死/完成的活动,它甚至有可能,如果是的话怎么就不能在的AsyncTask的doInBackGround()

I was wondering if its possible to create a Thread and kill/finish The Activity, is it Even possible, if yes then how come it does not work in AsyncTask's doInBackGround()

推荐答案

您应该只调用从UI线程完成()。

You should only call finish() from the UI thread.

这篇关于我可以杀死或完成()的活动的主题不是UI线程等..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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