Meghana M
Meghana M

Reputation: 535

Redirection to home after clicking on back button

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.

Upvotes: 3

Views: 1636

Answers (1)

Prakhar
Prakhar

Reputation: 710

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
        }

Upvotes: 2

Related Questions