里面的Andr​​oid AsyncTask的警报对话框 [英] alert dialog inside asynctask in android

查看:136
本文介绍了里面的Andr​​oid AsyncTask的警报对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要显示 Alertdialog 的AsyncTask 在Android中,但它那倒显示抛出异常。

I need to show the Alertdialog inside Asynctaskin android , but it won`t show in throws exception.

05-13 14:59:35.522: WARN/System.err(1179): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

感谢。

推荐答案

这是不可能操纵从后台线程的用户界面。使用上的的AsyncTask的pre /后处理的方法或。

It isn't possible to manipulate the UI from the background thread. Use handler or the onPre/Post methods of the AsyncTask for that.

这篇关于里面的Andr​​oid AsyncTask的警报对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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