ncapdevi/FragNav

How to Pop Specific Fragment?

Closed this issue · 2 comments

I have a scenario in which I have to pop the previous fragment and push new fragment I'm using slide left and slide right animation with my fragments when i try to do this

@Override
 public void pushFragment(Fragment fragment) {
     if (mNavController != null) {
         if (mNavController.getCurrentFrag() instanceof AboutYouFragment){
             mNavController.popFragment();
         }
         mNavController.pushFragment(fragment);
     }
 }

it causes bad animation both at the same time left and right.
What i want to do is first push the fragment and then pop the previous fragment.

It's managed as a stack, you can only ever pop the top fragment on a stack