android - How to autorun an application when the Phone is switched ON -
Can someone give me the code or links or concept to run the Android application automatically on the Android device.
You have to switch to a broadcast listeners Must announce that RECEIVE_BOOT_COMPLETED hears for
Use of Android-permission Android: name = "android.permission.RECEIVE_BOOT_COMPLETED" />
In your listener:
mystarterIntent = new intent (context, YOUR_CLASS_TO_START category); / * Set the launch-flag of the intent * / MyStarterIntent.setFlags (intestine. FLAG_ACTIVITY_NEW_TASK); MyStarterIntent.addFlags (Intent.FLAG_ACTIVITY_SINGLE_TOP); / * Intent to OS * / Context.startActivity (myStarterIntent);
Another example using the suggestions above:
Comments
Post a Comment