package ch.cern.cvmfs.fragments;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;


public abstract class CVMFSFragment extends Fragment {

	public boolean onBackPressed() {
		return false;
	}

	protected void replaceFragment(CVMFSFragment fragment, int containerId) {
		getChildFragmentManager().beginTransaction().replace(containerId, fragment).commit();
		getActivity().overridePendingTransition(0, 0);
	}

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		onPrepareInterface();
	}

	protected CVMFSFragment getCurrentFragment(int containerId) {
		try {
			return (CVMFSFragment) getChildFragmentManager().findFragmentById(containerId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * Called after onViewCreated
	 */
	protected abstract void onPrepareInterface();
}

@@ -447,16 +447,555 @@
 0);%0A%09%7D%0A%0A
+    protected void addFragment(CVMFSFragment fragment, int containerId) %7B%0A        getChildFragmentManager().beginTransaction().add(containerId, fragment)%0A                .addToBackStack(null).commit();%0A        getActivity().overridePendingTransition(0, 0);%0A    %7D%0A%0A    protected void removeFragment(int containerId) %7B%0A        CVMFSFragment currentFragment = getCurrentFragment(containerId);%0A        getChildFragmentManager().beginTransaction().remove(currentFragment).commit();%0A        getActivity().overridePendingTransition(0, 0);%0A    %7D%0A%0A
 %09@Overri

Add addFragment and removeFragment methods to CVMFSFragment