I have two activities
MainActivityDeepLinkActivityI set up everything to use the NavUtils for navi
Try the following answer working for me in both case start activity from notification and start an activity from parent activity.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
Intent upIntent = NavUtils.getParentActivityIntent(this);
if (NavUtils.shouldUpRecreateTask(this, upIntent) || isTaskRoot()) {
TaskStackBuilder.create(this).addNextIntentWithParentStack(upIntent)
.startActivities();
} else {
finish();
}
return true;
default:
return super.onOptionsItemSelected(item);
}
}