1. A service runs in the main thread of its hosting process-the service does not create
Its own thread and does not run
In a separate process (unless you specify otherwise)
Although the service does not have a UI, it cannot perform time-consuming operations. Otherwise, activitymanager still reports ANR. Even if the service is set to another process, the UI of the current process will not be blocked, however, the log is printed on the background, and the service in another process is about 30 s later than ANR .. And there is no prompt box for ANR to pop up...
2. startactivity
<Activity
Android: Name = "com. example. Call. myactivity"
Android: Label = "@ string/app_name2">
<Intent-filter>
<Action Android: Name = "ritter.com"/>
<Category Android: Name = "android. Intent. Category. Default"/>
</Intent-filter>
</Activity>
When you call an activity implicitly, you must specify the category default in intent-filter, because the default intent creates the category default.
Android treats all implicit intents passed to startactivity () as if they contained at least one category: "android. Intent. Category. Default"
(The category_default constant). Therefore, activities that are willing to receive implicit intents must include "android. Intent. Category. Default" in their intent Filters