Create a custom button
- by Beppi Menozzi
Sorry if this is too basic.
I created a new class that extends Button:
public class MyButton extends Button {
private Context ctx;
public MyButton(Context context) {
super(context);
ctx = context;
}
private void click() {
// DO WHAT I NEED (FOR EXAMPLE CHANGE BACKGROUND)
}
}
How can make it possible that, when I setOnClickListener() from another class where I instantiated this object, the click() method is called automatically?
Thanks.