So i need to change activity clicking a button and show the name inserted in the Edittext but seems im not able to get it done . Can someone help me please?
private Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button = findViewById(R.id.btn_Saludar);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openActivity2();
}
});
}
public void openActivity2() {
Intent intent = new Intent(this,Activity2.class);
startActivity(intent);
}
}