title: Android - what is the best way of using Activities (best practice)
body: <p>I'm writing my first Android app and want to pick up good coding practices. I have an Activity which contains the following:</p>
  
  <pre><code>Button btn = (Button)findViewById(R.id.btnPressMe);
  
          btn.setOnClickListener(new OnClickListener() {
  
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  startActivity(new Intent(Main.this, SecondScreen.class));
              }
          });
  </code></pre>
  
  <p>or</p>
  
  <pre><code>startActivity(new Intent("net.mysite.MediaPlayer.CLEARSCREEN"));
  </code></pre>
  
  <p><strong>AndroidManifest.xml:</strong></p>
  
  <pre><code>&lt;activity
          android:name=".landingpage"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="net.mysite.MediaPlayer.CLEARSCREEN" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>