Is there any way that i can achieve the launch mode single top feature in activity with fragment. Actually what i need is if there is any fragment exist on the top of the stack and if i am trying to add again, it should point to the same one which is already available on the top of the stack. Please help.
How to restrict fragment from adding to top of stack if it already exist in the top of stack in android
59 views Asked by varun kumar At
1
You can get fragment which is on top of the stack by this way getFragmentManager().getBackStackEntryAt(getFragmentManager().getBackStackEntryCount()-1)
Check if this is same as your fragment or not.