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.fragmentcon
You can try below code
getSupportFragmentManager().beginTransaction().remove(frag).commit();
*frag is the object of fragment that you want to remove.
OR
getFragmentManager().beginTransaction().remove(getFragmentManager().findFragmentById(R.id.your_container)).commit();
it will remove the fragment that is loded in "your_container" container.
HapPy coding.