private boolean showInitialFragment ( @ Nullable final String initialFragment ) { if ( ! TextUtils . isEmpty ( initialFragment ) ) { for ( int i = 0 ; i < navigationFragment . getNavigationPreferenceCount ( ) ; i ++ ) { NavigationPreference navigationPreference = navigationFragment . getNavigationPreference ( i ) ; if ( navigationPreference != null && navigationPreference . getFragment ( ) != null && navigationPreference . getFragment ( ) . equals ( initialFragment ) ) { Bundle arguments = getIntent ( ) . getBundleExtra ( EXTRA_SHOW_FRAGMENT_ARGUMENTS ) ; CharSequence title = getCharSequenceFromIntent ( getIntent ( ) , EXTRA_SHOW_FRAGMENT_TITLE ) ; if ( title != null ) { if ( arguments == null ) { arguments = new Bundle ( ) ; } arguments . putCharSequence ( EXTRA_SHOW_FRAGMENT_TITLE , title ) ; } navigationFragment . selectNavigationPreference ( i , arguments ) ; return true ; } } } return false ; }
Initially displays a specific fragment .