I want to change the destination on the up arrow created from the following actionbar:
// Get a support ActionBar corresponding to this toolbar
ActionBar ab = getSupportActionBar();
// Enable the Up button
ab.setDisplayHomeAsUpEnabled(true);
I realize that some aspects like the icon are modifiable. What about the functionality and changing R.id.home
to something else? Is this possible, or is the up arrow off limits, and I will have to create one myself and then modify it in my *.xml layout?
My end goal is to have it to send me to the previous activity instead of to the home affordance.
I already have an onBackPressed
as:
@Override
public void onBackPressed() {
super.onBackPressed();
this.finish();
}//end onBackPressed()