I am doing an app which lock the screen if we shake the phone, I had written the code for screen off,But now the problem is I need a broadcast receiver which checks whether the screen is off or on, how can I do it?
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.
hope this Link
Which help to u better way to implement BroadCastReciever invoking if screen is off in Android.
EDIT:
You have to Add permission into manifest just like: