基于android-2.3.3_r1源代码,跟踪一下App进程从主线程ActivityThreadmain()方法开始的执行流程

 

使用布局文件如下

<?xml version="1.0"encoding="utf-8"?>
<com.example.root.myapplication.MyFrameLayout
   
xmlns:android="http://schemas.android.com/apk/res/android"
   
xmlns:tools="http://schemas.android.com/tools"
   
android:layout_width="match_parent"
   
android:layout_height="match_parent"
   
tools:context="com.example.root.myapplication.MainActivity">

       <com.example.root.myapplication.MyTextView
           
android:id="@+id/tv"
           
android:layout_width="wrap_content"
           
android:layout_height="wrap_content"
           
android:text="Hello World!"
           
android:background="@android:color/white"
           
android:textColor="@android:color/black"/>

</com.example.root.myapplication.MyFrameLayout>

使用FrameLayoutTextView是因为其measure()layout()相对简单一些

 

执行流程如下

Activity、Window、View、Surface[0]日志 

相关文章:

  • 2022-12-23
  • 2021-05-13
  • 2022-01-02
  • 2022-12-23
  • 2021-05-13
  • 2021-09-20
  • 2022-12-23
  • 2021-09-06
猜你喜欢
  • 2021-04-20
  • 2021-08-20
  • 2021-06-04
  • 2021-05-05
  • 2022-03-04
  • 2021-04-18
  • 2021-08-27
相关资源
相似解决方案