Search code examples
androidandroid-fragmentsmethodsfragmentback-stack

BackStack android Fragment


How to popBackStack fragments by tag like this:

  • [c]
  • [b]
  • [a]

If findByTag [b] is exist then clear all elements of stack which are above of current fragment.

  • [b]
  • [a]

else If findByTag [d] does not exist then

  • [d]
  • [c]
  • [b]
  • [a]

Solution

  • I can only guess what you question is. Here is a link to Google's Tasks and Back Stack guide for you that might help.