Pero Pero - 1 year ago 70
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 Source

Just type final before your variable.
For example:

final button;

This should do the job.