Michael Jancen-Widmer Michael Jancen-Widmer - 1 year ago 223
Java Question

Android: Java Error Unexpected token (Array)

I am facing an error which isn't in fact an error. I am using Android Studio and want to create an Array but it tells me that there are unexpected token..

enter image description here

As you can see in the image I wanted to make a String Array, but things are not going as supposed to. Is this an error with Android Studio?

Answer Source

Move it to onCreate() and try again.

Or you may use as below

new way