How can i run an android service every 24 hours for 5 times and then don’t run it again.
I have already created the service class and named it ServiceActive.class . How can i achieve this?
Thank you in advance.
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 can use the alarm manager class to carry out tasks set in the future. this every time the alarm goes off, you can further its time by another 24 hours while reducing your counter by one. after the 5 counter decrements are done, you can just disable the alarm manager and thus never calling it again. i hope that helps you.