I want to navigate to another screen when user touch back button. I found a method for this.
@Override
public void onBackPressed() {
// do something on back.
return;
}
I'm navigating from a fragment.But it is not clear that where I have to use this and how. Please help.