你放在子线程里启动是错误的,AsyncTask是辅助用来后台执行,然后更新UI的,只能在UI线程下启动Threading rules 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. http://developer.android.com/intl/zh-cn/reference/android/os/AsyncTask.html
线程id就不一样了
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.
http://developer.android.com/intl/zh-cn/reference/android/os/AsyncTask.html