on view created fragment code example
Example: destory fragment
getSupportFragmentManager().beginTransaction().remove(yourFragment).commitAllowingStateLoss();
getSupportFragmentManager().beginTransaction().remove(yourFragment).commitAllowingStateLoss();