I made a very simple app on Android, theirs two line of code that just don't work.
The two lines
protected int images[];
images = [R.drawable.loading, R.drawable.loading1, R.drawable.loading2, R.drawable.loading3, R.drawable.loading4];
Yes, I know you can make these two lines one, but in the program one line is located at the start of the class and the other is located in onCreate().
Errors:
1.Red underline under the second "[" character. Message: Unexpected Token
2.Red underline under the second "]" character. Message: ; Expected
I'm a beginner in Android Development, this would work in As3, Javascript and C++ but doesn't seem to work here.
Many of you are telling me to use {} (braces) instead of [] (square brackets) but then a big chunk of code doesn't work. Here's the part that gets the Red underline:
{R.drawable.loading, R.drawable.loading1, R.drawable.loading2, R.drawable.loading3, R.drawable.loading4}
And here's the error I get: Array initializer not allowed here I'm using intelliJ if that helps. And again the first line is located at the start of the class and the other is located in 'onCreate()'.