Basically when BACK button is pressed on the phone, I want to prevent a specific activity to return to its previous one in android.
Specifically, I have login and sign up screens, both start a new activity called HomeScreen when successful login/signup occurs. Once HomeScreen is started, I want to prevent the users to be able to return login or sign up screens with pressing BACK key also I want them to be able to navigate between fragments in HomeScreen e.g They can navigate to fragments like share,communicate etc.
I thought of using finish() method on backKey pressed but that would exit an application and I don't want that too.