Override the onBackPressed()
of your activity
@SuppressLint("MissingSuperCall")
@Override
public void onBackPressed()
{
// super.onBackPressed(); // Comment this super call to avoid calling finish() or fragmentmanager's backstack pop operation.
}
You may suppress lint's error by adding @SuppressLint("MissingSuperCall")
as per Matthew Read pointed out.