title: Check if Intent exist
body: <p>In my program the user starts at the welcome page they use the app and need to enter details in order to continue. By the time they reach the Home page they will have entered a name and it will be passed as an intent to the home page.</p>
  
  <p>I wish for the user to be brought to the welcome page the first time they use the app and be brought to the home page all times after that.</p>
  
  <p>I am saving the name as shared preferences so it should be there always.</p>
  
  <p>so what I tried was to always send the user to the home page but if no Intents exist (i.e. first time) they will be brought to the home page but I could not get it working. Here is my effort.</p>
  
  <pre><code>public class HomeActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_home);
  
  
          Intent intent1 = getIntent();
          Bundle bundle = intent1.getExtras();
  
  
           if( intent1.getExtras() == null)
              {
                  Intent intent = new Intent(HomeActivity.this,Welcome.class);
                  startActivity(intent);
              } 
  
  
          final String name = bundle.getString("Name");
          final int targetTime = bundle.getInt("targetTime", 1);
  </code></pre>