So heres my problem. I set up a button that when clicked should open a new activity but when it is clicked I receive an error: Unfortunately \"app_name\" has stopped working my
You need to call another activity like this inside the OnClickListener() of button
Button mondayEdit= (Button)findViewById(R.id.button1);
mondayEdit.setOnClickListener(new OnClickListener()
{ public void onClick(View v)
{
Intent intent = new Intent(main.this, secondActivity.class);
startActivity(intent);
finish();
}
});
Probably your code is showing error due to Android manifest file, Try adding proper class in manifest file. Making first activity as main , and other as default.Others part of code is exactly fine.