title: Trying to start a new Activity using Intent
body: <p>I'm new to Android Dev, so please help me out.</p>
  
  <p>I'm trying to start a new activity after i press a button but nothing seems to work.
  Here's my code:</p>
  
  <pre><code>public class viewInfo extends Activity {
  private Button btn;
  public TextView txt;
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.info);
      btn=(Button)findViewById(R.id.buy);
  
      btn.setOnClickListener(new OnClickListener(){
  
          @Override
          public void onClick(View v) {
               Intent myIntent = new Intent(viewInfo.this, buyNow.class);
               startActivity(myIntent);
  
          }
  
      });
  
  
  }
  </code></pre>
  
  <p>I've also added this new activity in the Manifest but it keeps crushing after I press the button.
  What am I doing wrong?</p>