Is there a way to remove all fragments which already added the specific view with its view id?
For example I want to remove all fragments which is added R.id.fragmentcontainer view.
Is there a way to remove all fragments which already added the specific view with its view id?
For example I want to remove all fragments which is added R.id.fragmentcontainer view.
It is indeed very simple.
Its very simple just loop through all the fragments and remove it
But in case of Navigation Drawer be sure to check it, if you try to remove it you will get error.
Last but very important be sure to check for null before doing any fragment transactions