I have two few questions regarding a service notification in android:
-
How to cancel the service if I chose to restart my device ?
-
How to keep the service running if I shut down my device and power it up again ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You simple have to call the bootcompiled at the manifest file to recreate the service.
See below code:
Now if you dont want to re create the service when the device get restarted then simple define the receiver in manifest without any BOOT_COMPLETED action.
as like below code:
This is for receiver in My case. If you want the same thing for service then also you can do it.
hope it will help you.