7
Android基础知识:在UI线程中运行代码
从在UI线程中运行代码的角度来看,两者之间是否有任何区别: MainActivity.this.runOnUiThread(new Runnable() { public void run() { Log.d("UI thread", "I am the UI thread"); } }); 要么 MainActivity.this.myView.post(new Runnable() { public void run() { Log.d("UI thread", "I am the UI thread"); } }); 和 private class BackgroundTask extends AsyncTask<String, Void, Bitmap> { protected void onPostExecute(Bitmap result) { Log.d("UI thread", …