title: Start activity only once
body: <p>I want my app to start a activity only the first time the app launches.
  Any one got any idea?</p>
  
  <p>I found this but it only shows a black screen.</p>
  
  <pre><code>public class WhatsNew extends Activity {    
      public static final String PREFS_NAME = "MyPrefsFile";
      protected void onCreate(Bundle state){    
          super.onCreate(state);
          SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
          boolean dialogShown = settings.getBoolean("dialogShown", false);
              if (!dialogShown) {
                  // AlertDialog code here
                  SharedPreferences.Editor editor = settings.edit();
                  editor.putBoolean("dialogShown", true);
                  editor.commit();    
              }
          }
      }
  </code></pre>