Денис Климков Денис Климков - 1 year ago 87
Android Question

How prevent the transition to activity

I have two activities. One activity is the authorization activity and the other navigation drawer with fragments. When I walk the way of registration and get on the navigation, I should not get to the login activity using the system back button.

How can I block this transition, if my system buttons busy:

public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
} else {

Answer Source

Not sure if I understood correctly, but if you don't want your application coming back to login activity you should finish it after starting your navigation activity.

void onAuthorized() {
    Intent intent = new Intent(this, NavigationActivity.class);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download