AppCompatActivity onBackPressed() method fails to trigger in my activity.
I see the back arrow button and get the animation when pressing it, but nothing else happens. a
In your manifest file define the following inside your activity tag:
After that in your activity:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
default:
return super.onOptionsItemSelected(item);
}
}