I\'m trying to launch an activity from a notification like the Android docs explain, but when I open the notification and then press the back button, the HomeActivity (paren
As stated in other answers, TaskStackBuilder doesn't work for versions below Honeycomb.
My solution was to override the activity's onBackPressed()
method.
@Override
public void onBackPressed() {
NavUtils.navigateUpFromSameTask(this);
}
Obviously if you're planning on finishing the activity in some other manner you will have to handle that as well. (Though I imagine overriding finish()
will have some unexpected behaviour).