I have two activity MainActivity.java
and ListActivity.java
.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button = (Button)findViewById(R.id.nextButton);
button.setOnClickListener(new AdapterView.OnClickListener(){
public void onClick(View view){
startAc(view);
}
});
}
public void startAc(View view){
Intent intent = new Intent(this, ListActivity.class);
startActivity(intent);
}
As soon as I click the button, the Emulator gives an error Application has stopped working.
Is the use of Intent inappropriate?