title: start an activity after button click
body: <p>I want to start an activity only once after the application starts. I did this code:</p>
  
  <pre><code>Boolean isFirstRun = getSharedPreferences("PREFERENCE", MODE_PRIVATE)
              .getBoolean("isFirstRun", true);
  
      if (isFirstRun) {
          //show start activity
  
          startActivity(new Intent(MainActivity.this, FirstLaunch.class));
          Toast.makeText(MainActivity.this, "First Run", Toast.LENGTH_LONG)
                  .show();
      }
  
  
         getSharedPreferences("PREFERENCE", MODE_PRIVATE).edit()
                  .putBoolean("isFirstRun", false).commit();
  </code></pre>
  
  <p>but it didn't work for the thing that I want. I want when I click on a button and  launch the activity. But the main activity launches </p>