I am developing a small android application for my martial arts club however, whenever it opens, it force closes straight away.
The way it is meant to go is like so.. You open the app (loads main.xml) then you press a button (button1) to continue to bels.xml. So far, I am trying to make the whitebelt button (button2) go to whitebelt.xml.
I have the pages/screens created and here is the activity.java file.
[Java] EvolutionTheoryHelperActivity.java - Pastebin.com
Now, its this part that is causing the issue as if I remove it, it works fine... However it doesn't allow my button2 to work.
Do you think you could help?
Regards,
--Conor Calby
The way it is meant to go is like so.. You open the app (loads main.xml) then you press a button (button1) to continue to bels.xml. So far, I am trying to make the whitebelt button (button2) go to whitebelt.xml.
I have the pages/screens created and here is the activity.java file.
[Java] EvolutionTheoryHelperActivity.java - Pastebin.com
Now, its this part that is causing the issue as if I remove it, it works fine... However it doesn't allow my button2 to work.
Code:
Button button2 = (Button)this.findViewById(R.id.button2);
button2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View whitebelt) {
// button 1 was clicked!
setContentView(R.layout.whitebelt);
}
});
Regards,
--Conor Calby