How to toggle onClick within ArrayAdapter
<p>In getView of my ArrayAdapter I have: </p>

<pre><code>final Button myButton = (Button) row.findViewById(R.id.myButton);
final int myId = myList.get(position).myId;
myButton .setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View v) {
        ((MyActivity)mContext).myMethod(myId);
    }
});
</code></pre>

<p>myMethod makes a certain API call if myId = -1 and a different API call if myId != -1.
The API returns the new value of myId, which basically flips.  It becomes -1 if it was a positive integer and becomes a positive integer if it was -1.</p>

<p>Now depending on the new value of myId I need to set myButton's text and color and need the onClick to be called with the updated value of myId.  How can I accomplish this from MyActivity?</p>
