ncapdevi/FragNav

How to Remove fragment from stack

Closed this issue · 3 comments

I want to have just one instance of a particular fraction in the stack.
I do this as follows, but it does not work properly and the target fugue is not deleted.

`

            for(int i =0 ; i <mFragNavController.getStack(FragNavController.TAB1).size() ; i++){
                Object object = mFragNavController.getStack(FragNavController.TAB1).get(i);
                if (object instanceof MyFragment)
                    mFragNavController.getStack(FragNavController.TAB1).remove(i);
            }

`

That's not how stacks work https://en.wikipedia.org/wiki/Stack_(abstract_data_type) and that functionality it outside the scope of this library and will not be included.

@smrahmadi did you find a proper solution?