Heloo everyone
im new to android development
and im developing an android application for my graduation project
my application must start when the device boot up
so to that i put these lines in the AndroidManifest file
<!--this to make app run at start up-->
<receiver android:name="MyIntentReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
so my program run autmaticlly when boot complete.
my question is how to stop this by user?? i want to put a toggle button on/off
for this option so the user can chose if he want the app to start automaticlly in background or manually ???
thanks in advance
This sounds pretty straight forward. Basically, when the phone starts, the Receiver class “MyIntentReceiver” will run. Inside this receiver you can put code based on user preferences to either start the application or do nothing. The toggle would be a CheckBoxPreference in the user preferences.
Let me know if you have any questions.