Added MainActivity.onBackPressed
This commit is contained in:
parent
acf735a050
commit
cdfc6c2f06
@ -99,6 +99,16 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
|||||||
updateUserInterface(getIntent());
|
updateUserInterface(getIntent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.main_drawer_layout);
|
||||||
|
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
||||||
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
} else {
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user