search

Home  >  Q&A  >  body text

android - ActivityThread的main() 和Application的onCreate() 都是应用的入口?

它们有什么区别?

一个是应用程序的java入口?
一个是应用程序的android应用入口?

那么一个app启动加载的第一类就是ActivityThread吗?
关于这种问题,我应该怎么样自己测试得到结果呢?(而不是一有问题就到网站求助?)

大家讲道理大家讲道理2772 days ago554

reply all(5)I'll reply

  • 黄舟

    黄舟2017-04-18 09:06:29

    Now that you have said that, I recommend you a website called Baidu. There is a box in the middle of the website. If you don’t understand anything, enter it first and click "Baidu" on the right.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-18 09:06:29

    A process should have only one entry main function

    reply
    0
  • 高洛峰

    高洛峰2017-04-18 09:06:29

    The main method of Activitythread is the real entrance. He managed the creation of the four major components of Android

    reply
    0
  • 阿神

    阿神2017-04-18 09:06:29

    The entrance to the Android application is defined in AndroidManifest.xml.
    As shown below:

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 09:06:29

    Because ActivityThread belongs to the framework source code, so if you want to verify it by logging, it is impossible.

    You can only look for clues from ActivityThreadmain方法中去寻找线索,看看里面是如何进入ApplicationonCreate's main method to see how it enters the onCreate function of Application

    reply
    0
  • Cancelreply