I am making a game in android. I want to make a main menu screen that has two buttons, one to start the game and one to display the how to screen.
I have classes for both, but when I launch my name and test the buttons, the application crashes. Could someone please tell me what is wrong with my code?
public void launch()
{
Intent i = new Intent();
i.setClassName("com.testing.blockinvasion", "com.testing.blockinvasion.game");
startActivity(i);
}
public void howto()
{
Intent i = new Intent();
i.setClassName("com.testing.blockinvasion", "com.testing.blockinvasion.howto");
startActivity(i);
}
}
My buttons are defined in my main.xml:
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/Start"
android:onClick="launch" />
EDIT: I ended up just deleting the project and starting another one and everything seems to work fine now.