I needed to change variables inside an inner class and I got the infamous \"Cannot refer to a non-final variable inside an inner class defined in a different method\" error.
I would keep a reference to your on click listener in the outer class, and make the int a member variable in your listener. Just store the variable in the listener on click, then grab the variable in the outer class when you need it, rather than setting it at the point of the click.
To put it simply, if the inner class needs to change it, make it a variable in the inner class.