private void addFragmentToView ( final int viewId , final Fragment fragment ) { fragmentManager . beginTransaction ( ) . replace ( viewId , fragment ) . commit ( ) ; }
Use FragmentManager to attach one fragment to one view using the viewId .