前言
看到标题,你可能会觉得我想写的,ViewRoot没创建的时候可以直接更新嘛.
然而并不是.哈哈
checkthread
可以看到,checkthread()在viewroot的以下地方调用.
在看一份代码:
布局
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv_content"
android:background="#0ff"
android:layout_width="match_parent"
android:layout_height="match_parent"