Only the original thread that created a view hierarchy can touch its views警告
由于 继承AsyncTask的类中 重写的方法中doInBackground(String... params) view更新操作,只要将view的更新操作放在onPostExecute(String result)方法中
本文解决了一个关于AsyncTask中视图更新的问题。当在AsyncTask的doInBackground方法中尝试更新UI时,会触发Onlytheoriginalthreadthatcreatedaviewhierarchycantouchitsviews警告。正确的做法是在onPostExecute方法中进行UI更新。
Only the original thread that created a view hierarchy can touch its views警告
由于 继承AsyncTask的类中 重写的方法中doInBackground(String... params) view更新操作,只要将view的更新操作放在onPostExecute(String result)方法中
5209

被折叠的 条评论
为什么被折叠?