0

When my user clicks on the About item in my menu, I launch an AboutFragment that displays all the necessary information.

In order to go back to the calling activity, I have set a back arrow with

((MainActivity)getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);

When my user clicks it I call finish(), but this causes a small animation where my Activity replaces the fragment and lifts up.

Would there be a way to have my activities view replace my fragment with no animation?

2 Answers2

2

Animation is caused due to fragment transaction you can use this to remove it.

 fragmentTransaction.setCustomAnimations(0,0);
santosh kumar
  • 2,952
  • 1
  • 15
  • 27
1

I have found the following solution here.

finish();
TrakrActivity.this.overridePendingTransition(0, 0);

I override a pending transition and sets it to nothing (0,0).

Community
  • 1
  • 1