Can I assign a “default” OnClickListener() for an Android Activity?
问题 I have an Activity that, for each widget in the layout, I call setOnClickListener() to assign my OnClick() handler. In my OnClick() handler I use a switch statement to execute the desired code for each button based on the View parameter's ID. Is there a way to assign a default handler to the main view instead of having to make individual listener assignment calls for each widget in the view? ================================================ UPDATE Thanks to kcoppock's starting sample I have