由于代码中涉及到UI的布局,不得已看android源码。

源码系android-8即2.2

从调试环境看最初调用NativeStart.java中的main函数,经过底层的若干次调用,途经ActivityThread.java中的main函数调用,代码如下:

void main(String[] args) {
     SamplingProfilerIntegration.start();
 
     Process.setArgV0("<pre-initialized>");
 
     Looper.prepareMainLooper();
 
     ActivityThread thread = new ActivityThread();
     thread.attach(false);
 
     Looper.loop();
 
     if (Process.supportsProcesses()) {
         throw new RuntimeException("Main thread loop unexpectedly exited");
     }
 
     thread.detach();
     String name = (thread.mInitialApplication != null)
         ? thread.mInitialApplication.getPackageName()
         : "<unknown>";
     Slog.i(TAG, "Main thread of " + name + " is now exiting");
 }

相关文章:

  • 2022-01-08
  • 2021-05-15
  • 2021-10-08
  • 2022-12-23
  • 2021-12-28
  • 2021-07-05
  • 2021-08-26
猜你喜欢
  • 2021-10-04
  • 2021-11-28
  • 2021-10-01
  • 2021-08-22
  • 2021-07-23
  • 2021-11-28
相关资源
相似解决方案