title: Launch activity in activity
body: <p>I'm trying to make Android application in Eclipse which should consist of 2 activities : first activity where user fills in fields and second activity which should be launched by pressing a button in first activity.</p>
  
  <p>I've read many topics about intents, received all possible information about intent filters, but i still can't just create a button and use intent to launch activity.</p>
  
  <p>Help, please.</p>
  
  <p>It will be awesome if you've got something like a step-by-step instruction how to do that.</p>
  
  <p>Ok, here's what i've made following your answers --></p>
  
  <p>I've created an application.
  There are 4 java files in src :<br>
  Activity1.java - activity which i want to have a button to launch Activity2,
  <br>Activity2.java - which is in default state,<br>MyActivity.java - created to paste code received by 1Up,<br>View.java - empty class, which i created because without it i see many errors, dunno how to normally remove them.</p>
  
  <p>Then i put 1Up's code in MyActivity, edited it slightly and this is what i've got :</p>
  
  <pre><code>public class Activity1&lt;i&gt; extends Activity {
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.activity1, menu);
      return true;
  }
  public void onCreate() {
      // TODO Auto-generated method stub
  
  }
  
      public void goToOtherActivity(View view)
      {
          Intent i = new Intent(this, Activity2.class);
          this.startActivity(i);
      }                                        }
  </code></pre>
  
  <p>Then i thought now i can attach goToOtherActivity to onClick in Activity1 but it was able to be added only like text, so when i launch app on AVD it gives a lot of warnings </p>