How do I set the activity of the Android Up-button

2019-08-02 19:25发布

问题:

The following two methods seem like they should do the trick, but I can't get them to work. Does anyone how to get these methods to work, or know of another way?

getSupportParentActivityIntent http://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html#getSupportParentActivityIntent()

onCreateSupportNavigateUpTaskStack http://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html#onCreateSupportNavigateUpTaskStack(android.support.v4.app.TaskStackBuilder)

回答1:

How to implement getSupportParentActivityIntent() to set the activity dynamically for up-button in android