How to keep an Activity running/active when the screen shuts off?
Share
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 will need to use a PARTIAL_WAKE_LOCK to ensure that your activity is kept active.
android.permission.WAKE_LOCKmust be requested in your manifest. However, battery will drain faster, so do remember to release the wakelock as soon as possible.Alternately, use a Service instead