1
I put a button on activity_main
and I made a second canvas.
The idea was, by clicking the button, to press this other screen. And in the class MainActivity.java
I put that when I hit the button, I would load the screen.
But when you click the button, absolutely nothing happens.
Does anyone there have any idea what it might be?
public class MainActivity extends Activity {
Button btCadastro;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btCadastro = (Button) findViewById(R.id.btCadastro);
btCadastro.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
chamaCadastro();
}
});
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
}
public void chamaCadastro(){
setContentView(R.layout.telacadastro);
}
@Walkim I’ll take a look at this part of the documentation. Thanks for the help!
– emanuelsn