2021届阅文Android方向笔试卷
时长:120分钟 总分:100分
241浏览 0人已完成答题
题型介绍
题型 | 填空题 | 简答题 |
---|---|---|
数量 | 5 | 20 |
请写出下面代码输出结果是怎么样的。 public class MainT...
public class MainThreadTestActivity extends AppCompatActivity { private static final String TAG = MainThreadTestActivity.class.getSimpleName() @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main_thread_test) View view = new View(this) view.post(new Runnable() { @Override public void run() { Log.i(TAG, "[view.post] >>>> 1 ") } }) new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { Log.i(TAG, "[handler.post] >>>> 2") } }) runOnUiThread(new Runnable() { @Override public void run() { Log.i(TAG, "[runOnUiThread] >>>>> 3") } }) new Thread(new Runnable() { @Override public void run() { runOnUiThread(new Runnable() { @Override public void run() { Log.i(TAG, "[runOnUiThread from thread] >>>> 4") } }) } }).start() } }