Android stopped state
suggest changeStarting with Android 3.1, an application is placed in the stopped state when it is installed. While it is stopped, it will not run unless the user launches an activity, or an explicit intent targets one of its activities, services, or broadcast receivers.
A system app that installs APKs itself must account for this. The new app will not receive ordinary broadcasts until it leaves the stopped state.
One way to activate it is to send an explicit broadcast. Many apps declare an INSTALL_REFERRER receiver, which can be used as the target.
Read the installed app’s manifest and send an explicit broadcast to that receiver:
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
intent.setComponent(new ComponentName(packageName, fullClassName));
sendBroadcast(intent);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents