Intent flag for Navigating Up to parent activies on Android

the intent flag for navigating up to the parent activities on when the home button on the actionbar is pressed up is:

intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);

*hint: if you are using the compatibility library to implementing the action bar please refer to the actionbarcompat example on android developer resource site with the actionbarcompat repo on googlecode, and enable it by using this code:

ActionBarHelper actionBarHelper = getActionBarHelper();
actionBarHelper.setDisplayHomeAsUpEnabled(true);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s