I\'ve started working on an app. I build the menu yesterday but the onClick method doesn\'t work! I created a class that extends View and called her MainMenuObject - that cl
I do this so:
public class YourView extends LinearLayout implements OnClickListener {
OnClickListener listener;
//... constructors
public void setOnClickListener(OnClickListener listener) {
this.listener = listener;
}
@Override
public void onClick(View v) {
if (listener != null)
listener.onClick(v);
}
}