I use an intent to call a new class and show a new layout with some buttons on.
Intent intent = new Intent(MainActivity.this, Game.class);
setContentView(R.layout.game);
After this i want to show/hide some buttons on the second (game) layout.
i try to find the button:
button0 = (Button) findViewById(R.id.button0);
The thing is when i debug it never goes into the new Game-class and in my Main it can´t find my buttons because they are on the other layout.. how can i solve this?
use
instead of
if you want to move from MainActivity class (Activity) to Game.class (Activity)