I did a android application which launch just after boot finishes. It works in android 2.3.3 and Android 3.1 but when i force closed application which runs in android 3.1 and i reboot again the application doesn't come after boot ?
2 Answers
when i force closed application which runs in android 3.1 and i reboot again the application doesn't come after boot ?
Correct. On Android 3.1+, the following types of applications will not run automatically:
- Applications that are newly installed
- Applications that the user has "force stopped"
Those applications must first manually be started by the user (e.g., launching one of your activities) before they will receive any broadcast Intents again.
Comments
i do it with this code and it works for me:
public class AutoStarter extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) { Intent serviceLauncher = new Intent(context, your.class); context.startService(serviceLauncher); } } } for testing you can use this in your cmd
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED
1 Comment
Sarith Vasu
thanks Boe.. i also diid the same kind of code but question is different ........