title: Android Intent putExtra vs Static calls?
body: <p>I am launching activities using an Intent as follows:</p>
  
  <p>origin:</p>
  
  <pre><code>public class ChallongeLogin extends Activity
  {
      public static String API_KEY, SUBDOMAIN;
  
      public void onClick(View view)
      {
          API_KEY = api_key.getText().toString();
          SUBDOMAIN = subdomain.getText().toString();
  
          Intent intent = new Intent(this, ChallongeEvents.class);
          startActivity(intent);
      }
  }
  </code></pre>
  
  <p>target:</p>
  
  <pre><code>public class ChallongeEvents extends Activity implements View.OnClickListener 
  {
      String API_KEY = ChallongeLogin.API_KEY;
      String SUBDOMAIN = ChallongeLogin.SUBDOMAIN;
  
      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_challonge_events);
      }
  }
  </code></pre>
  
  <p>As you can see, all I am doing is when the <code>ChallongeEvents</code> class is created, I just take the static values from <code>ChallongeLogin</code> and put them into local variables.</p>
  
  <p>Now looking at Google's official Android tutorials here:
  <a href="http://developer.android.com/training/basics/firstapp/starting-activity.html" rel="nofollow">http://developer.android.com/training/basics/firstapp/starting-activity.html</a></p>
  
  <p>They do it a little differently. Instead of using static values called from the origin source, they pass the data long with <code>putExtra</code>:</p>
  
  <pre><code>intent.putExtra(EXTRA_MESSAGE, message);
  </code></pre>
  
  <p>And then they retrieve it with:</p>
  
  <pre><code>String message = intent.getStringExtra(MyActivity.EXTRA_MESSAGE);
  </code></pre>
  
  <p>Why are they doing these extra steps? Is there something wrong with the way I am doing it?</p>