Can I know which key has pressed when application did enter background? “Home” button or “On/Off” button.
Can I know which key has pressed when application did enter background? Home button
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.
No, there are a variety of reasons your application can enter background, but you just know that the state has changed.
Without using private APIs, there is no way to know for sure. In addition to the user pressing a button, your application can enter the background for auto-lock events, for example, so even the assumption that a button was pressed may be wrong.