Is it possible to lock a user in an activity, so that it is impossible to navigate away from it without entering a pin or in other ways “unlocking”? If so, how?
Would be very useful for a an app used in a public setting, like a tablet on display.
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 cannot stop the user from navigating away from your application via the home button (and you cannot stop other activities from opening). However you are notified when these things happen through your onPause() callback, and if the user returns to you, onResume() is called. You can require a pin at the point of resumption.