I. Activation of activity requires two Binder threads (binder_1; binder_2) support. Starting the service is also required. The main thread of both of them is activitythread. Looper.loop () is called in Activitythread's main (string[] args).
public static void Main (string[] args) {
Samplingprofilerintegration.start ();
Closeguard.setenabled (FALSE);
Environment.initforcurrentuser ();
Eventlogger.setreporter (New Eventloggingreporter ());
Security.addprovider (New Androidkeystoreprovider ());
Final File Configdir = Environment.getuserconfigdirectory (Userhandle.myuserid ());
Trustedcertificatestore.setdefaultuserdirectory (Configdir);
Process.setargv0 ("<pre-initialized>");
Looper.preparemainlooper ();
activitythread thread = new Activitythread ();
Thread.attach (false);
if (Smainthreadhandler = = null) {
Smainthreadhandler = Thread.gethandler ();
}
asynctask.init ();
if (false) {
Looper.mylooper (). setmessagelogging (New
Logprinter (Log.debug, "Activitythread"));
}
Looper.loop ();
throw new RuntimeException ("Main thread loop unexpectedly exited");
}
Two. For the four components defined in the same androidmanifest.xml, unless specifically stated ( back to add ), they all run in the same process (and are handled by the main thread)
Android Processes and Threads