In some part of my app's code I have a method that shows an AlertDialog to get a value(number) from the user. But when I try to save it in a variable (int) and return it I get this compile error:
The error says: "Cannot refer to a non-final variable bet inside an inner class defined in a different method"
So I try making bet a final variable, getting a new error: "The final local variable bet cannot be assigned, since it is defined in an enclosing type"
My idea is to call that method, show the alert dialog, get the input value and return it.