Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
此错误是在非UI线程中更新UI所造成的,解决方案如下:(注:在需要更新UI的地方调用new LongTimeTask().execute("此处为任意字符或空均可");)
private class LongTimeTask extends AsyncTask<String, Void, String> {@Overrideprotected String doInBackground(String... params) {return params[0];}@Overrideprotected void onPostExecute(String result) {//更新UI的操作,这里面的内容是在UI线程里面执行的}}