3

I am creating an app, which will ask for password before opening any other app. To start my activity i have created an intent which is having flags as , intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

The locking/unlocking function is working properly, but when i press back button it is not redirecting to home screen.

2
  • There is nice article about activity starting flags inthecheesefactory.com/blog/… Commented Apr 27, 2015 at 7:58
  • use like this: in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TASK); Commented Apr 27, 2015 at 7:59

1 Answer 1

2

Make sure you have not finished your home screen activity.. or you can try the onBackPressed() method

 @Override public void onBackPressed() { // INTENT FOR YOUR HOME ACTIVITY } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.