本文介绍了如何提高在AsyncTask的举杯,提示我用的活套的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得的AsyncTask在后台完成的任务。在某些时候,我需要发布的东西是完成了一个敬酒。
I have tasks completed by AsyncTask in background. At some point I need to issue a Toast that something is completed.
我试过,我失败了,因为产生的原因:java.lang.RuntimeException的:内螺纹已经不叫尺蠖prepare无法创建处理程序()
I've tried and I failed becauseCaused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
我怎么能这样做?
推荐答案
onPostExecute - 执行UI线程要么 publishProgress()
;在doinbackground和
onPostExecute - executes on UI threador publishProgress()
; in your doinbackground and
protected void onProgressUpdate(Integer... progress) {
}
http://developer.android.com/reference/android/os/AsyncTask.html
这篇关于如何提高在AsyncTask的举杯,提示我用的活套的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!