How to run a loop on a bunch of Android buttons that need to control their neighbors?
<p>I have a list of text inputs that each contain numbers.  To the left of each is a button that says " - " to the right one that says " + ".</p>

<p>So, it looks like this:</p>

<pre><code>[ - ] [ 1111 ] [ + ]
[ - ] [ 1112 ] [ + ]
[ - ] [ 1113 ] [ + ]
etc...
</code></pre>

<p>I want each [-] to alter the value of the field next to it, reducing it by 1, and each [+] to increment the value of the field left of it.</p>

<p>Is there a way that I can write a generic listener that would, upon instantiation, take as a param the id of the text field to be edited?
setOnClickListener only takes a View.OnClickListener as a param, and that can't be given any extra params to hang onto either.  Do I have to extend View.OnClickListener with my own custom listener to do this? Or is there some obvious way to accomplish this task that I'm overlooking?</p>

<p>TIA.</p>
