public void switchToHeader(String fragmentName,Bundle args){
  Header selectedHeader=null;
  for (int i=0; i < mHeaders.size(); i++) {
    if (fragmentName.equals(mHeaders.get(i).fragment)) {
      selectedHeader=mHeaders.get(i);
      break;
    }
  }
  setSelectedHeader(selectedHeader);
  switchToHeaderInner(fragmentName,args);
}

public void switchToHeader ( String fragmentName , Bundle args ) { Header selectedHeader = null ; for ( int i = 0 ; i < mHeaders . size ( ) ; i ++ ) { if ( fragmentName . equals ( mHeaders . get ( i ) . fragment ) ) { selectedHeader = mHeaders . get ( i ) ; break ; } } setSelectedHeader ( selectedHeader ) ; switchToHeaderInner ( fragmentName , args ) ; }
when in two - pane mode , switch the fragment pane to show the given preference fragment .
