Closed bakbuz closed 9 years ago
When are you calling such methods? And what you're trying to do with them?
Select one of the items listed to open and display the details so that I want to active the back button on the screen
Then getSupportActionBar().setDisplayHomeAsUpEnabled(true);
will work:
@Override
public void onNavigationDrawerItemSelected(int position) {
Toast.makeText(this, "Menu item selected -> " + position, Toast.LENGTH_SHORT).show();
if( getSupportActionBar()!=null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
How can I run?
code: getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);