I'm just starting out with Android and I followed this guide on adding the Up navigation to an Activity on the Action Bar.
http://developer.android.com/training/implementing-navigation/ancestral.html
However, the transition of when I use the up button from the Action Bar makes it show as the fade-in transition of opening a new activity rather than the fade-out that it should be, as it does when pressing the back button on the bottom.
What can I do to make it display the correct transition? Thanks.
Declare android:launchMode="singleTop"
inside your Manifest.xml for your parent Activity.
The transition will then change to the default fade out when calling something like:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
(from: http://developer.android.com/training/implementing-navigation/ancestral.html#NavigateUp)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With