Pero Pero - 1 month ago 8
Java Question

Variable needs to be declared from inner class

In android studio I have a problem:

variable 'button' is accessed from withing inner class, needs to be declared final.


How do I fix this ?

Answer

Just type final before your variable.
For example:

final button;

This should do the job.