title: Show Fragment on First Launch
body: <p>I'm trying to show a fragment only on the first time the application is launched. What I'm trying works to show the fragment but it always shows, I only want it to show on first launch.
   I'm replacing fragments from a method called <code>displayView</code>, in a navigation drawer drawerlistener (this may be my problem), im trying to use a boolean and shared preferences in my method. Any ideas as to why this isn't working</p>
  
  <pre><code>mDrawerLayout.setDrawerListener(mDrawerToggle);
  
          if (savedInstanceState == null) {
              // on first time display view for first nav item
              firstTimeFrag();
          }
      }
      private boolean firstTimeFrag(){
          SharedPreferences pref = getPreferences(MODE_PRIVATE);
  
          boolean ranBefore = pref.getBoolean("RanBefore",false);
          if(!ranBefore){
          SharedPreferences.Editor editor = pref.edit();
          editor.commit();
          Fragment fr = new ifFirstTimeFrag();
          FragmentManager fm = getSupportFragmentManager();
          FragmentTransaction fragmentTransaction = fm.beginTransaction();
          fragmentTransaction.replace(R.id.frame_container, fr);
          fragmentTransaction.commit();
      }else{
              displayView(0);
          }
      return ranBefore;
  }
  </code></pre>