Define once an event listener for multiple widgets
<p>Given <em>N</em> widgets of the same 'kind' (intentionally avoiding the <em>class</em> or <em>type</em> terms here for avoiding confusion), I'd like to assign the same event listener to all of them in an idiomatic way.</p>

<p>For clarity, it'd be something akin to <code>$(".foo").click(...);</code> in jQuery. Notice the class selector.</p>

<p>Right now I can code it in a fairly concise way, but I was wondering whether there is an specific mechanism in Android for achieving this.</p>

<p><strong>Update</strong> - example:</p>

<pre><code>    button1 = (Button) findViewById(R.id.button1);
    button2 = (Button) findViewById(R.id.button2);
    ...
    buttonN = (Button) findViewById(R.id.buttonN);

    buttons = new Button[]{button1, button2, ..., buttonN};

    // Pretty imperative.
    // Would't it be better to specify that all buttons belong to the same 'kind',
    // and set a listener to that 'kind'?
    for (int i = 0; i &lt; buttons.length; i++)
        buttons[i].setOnClickListener(...);
</code></pre>
