I'm new to Android Dev, so please help me out.
I'm trying to start a new activity after i press a button but nothing seems to work. Here's my 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); } }); } I've also added this new activity in the Manifest but it keeps crushing after I press the button. What am I doing wrong?