After 3.1, the system's package manager adds to the management of the "Stopped state" application, which is completely different from the stop status in the stopped and activity lifecycle. Refers to an application that has never been started after installation and is manually forced to stop by the user, while the system adds 2 flag:flag_include_stopped_packages and Flag_exclude_stopped_packages, To identify whether a intent activates an app that is in "stopped state". When 2 flags are not set or are set, the Flag_include_stopped_packages effect is used.
With the new mechanism above, Google think to all the broadcast intent default plus flag_exclude_stopped_packages will be very cooooool, to a certain extent, to avoid the rogue software, virus ah bad, but also to improve efficiency, Causes the problem in the topic of this article, receive_boot_completed broadcast if the user has not run the application, it will not respond.
But Google has left a bit of room for custom broadcasts that we can
SetFlags (Intent.flag_include_stopped_packages), this method to wake up in the "STOPPED state" of the program, that is, users write their own broadcast Intent can control this mechanism, But the system comes with the broadcast intent, because cannot modify, can only accept this reality
For example:
Intent startintent = new Intent ();
Startintent.putextra ("pkg", Getpackagename ());
Startintent.setaction ("Com.lenovo.speechcamera.start");
Startintent.setflags (intent.flag_include_stopped_packages);
Sendbroadcast (startintent);
Analysis of the problem that the Android4.0 system does not receive the broadcast