FragmantClass rSum = new FragmantClass();
getSupportFragmentManager().beginTransaction().remove(rSum).commit();
I am trying to remove this fragm
In my personal case, I add and remove fragment this way:
if(getSupportFragmentManager().findFragmentById(R.id.container) != null) {
getSupportFragmentManager()
.beginTransaction().
remove(getSupportFragmentManager().findFragmentById(R.id.container)).commit();
}
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.container, fragment)
.commit();