Actually, in my app, I want to call a function when the user clicks the home button. Can anyone suggest to me how that can be done?
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.
The only way to handle the home button action is by creating a home replacement activity. This is an activity with action ‘main’ and category ‘home’. This is for security issues, to prevent applications from locking users.