user5448913
user5448913

Reputation:

Remove animation on fragment .finish()

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?

Upvotes: 0

Views: 2043

Answers (2)

user5448913
user5448913

Reputation:

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).

Upvotes: 1

santosh kumar
santosh kumar

Reputation: 2962

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

 fragmentTransaction.setCustomAnimations(0,0);

Upvotes: 2

Related Questions