Hopefully one of you can minus and divide my problem by enlightening me.
I have an java file with a button inside, what it does is ( setContentView(R.layout.main2); )
in main2, i also have another button.
And i want that button to link it back to the first page.
- Code: Select all
button2.setOnClickListener(new View.OnClickListener() {
public void onClick(View view){
setContentView(R.layout.main)}
But apparently i keep getting null pointer exception error in logcat.
The question is, if i have a java file, and i need to change layout, where do i code the 2nd button ?
( there is 1 button in main , and 1 button in main2)
Pls revert asap. Million Thanks !!




