I am going crazy now. Googled this, thought some kind of IDE bug. Maybe I am blind and can not see something...but this was OK just an hour ago. I commented out all of the c
It's not an IDE bug.
You have a semicolon after the closing } of the enum. That is not required.
You've also got mPlayer = new MediaPlayer();
floating in your code, outside a method.
I'd suggest reading a good book on Java, like this one: http://www.amazon.co.uk/Agile-Java-Crafting-Test-Driven-Development/dp/0131482394
And a good book on Android: http://www.amazon.co.uk/Android-Application-Development-Dummies-Computers/dp/047077018X/ref=sr_1_1?s=books&ie=UTF8&qid=1333106527&sr=1-1
This is the actual problem:
mPlayer = new MediaPlayer();
That's just a statement - but it's not in a constructor, method or other initializer. It's not clear why you don't just assign a value at the point of the declaration:
private MediaPlayer mPlayer = new MediaPlayer();
I'd also recommend removing the redundant semi-colon at the end of the enum declaration.
The problem is here.
mPlayer = new MediaPlayer();
You assign the value at the point of declaration. Just like this.
public class CityExplorerPoi extends Activity {
private POI displayedPOI = null;
enum audioState {
Idle, //Idle, not initialized
Initialized, //Initialized, not prepared
Prepared, //Prepared
Started, //Playing
Stopped, //needs preparing
Paused, //can be Started or Stopped
Preparing, //...
End, //Released, useless
Error, //...
PlaybackCompleted //can be Started from beginning or Stopped
};
audioState aState;
MediaPlayer mPlayer = new MediaPlayer();
}