I would like to know the following, I have: ImageButton btneditarusuario;
and a TextView editarusuario;
, clicking on either one starts startActivity
.
How to group ImageButton
with TextView
so you do not have to repeat the code?
The code:
editarusuario.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), EditarUsuario.class));
}
});
btneditarusuario.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), EditarUsuario.class));
}
});