android add back button to toolbar
getSupportActionBar().setDisplayHomeAsUpEnabled(true);getSupportActionBar().setDisplayShowHomeEnabled(true);
android add back button to toolbar
getSupportActionBar().setDisplayHomeAsUpEnabled(true);getSupportActionBar().setDisplayShowHomeEnabled(true);
android back press toolbar
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// this takes the user 'back', as if they pressed the left-facing
triangle icon on the main android toolbar.
// if this doesn't work as desired, another possibility is to call
stopActivityTask(); // finish() here.
getActivity().onBackPressed();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
android add back button to toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);setSupportActionBar(toolbar);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us