您的位置:首页 > 运维架构

new a AsyncTask cause 'Can't create handler inside thread that has not called Looper.prepare()'

2014-05-09 16:39 246 查看
Can't create handler inside thread that has not called Looper.prepare()

There are a few threading rules that must be followed for this class to work properly:

The AsyncTask class must be loaded on the UI thread. This is done automatically as of
JELLY_BEAN
.
The task instance must be created on the UI thread.
execute(Params...)
must
be invoked on the UI thread.
Do not call
onPreExecute()
,
onPostExecute(Result)
,
doInBackground(Params...)
,
onProgressUpdate(Progress...)
manually.
The task can be executed only once (an exception will be thrown if a second execution is attempted.)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: