ERROR: “Syntax error on token ”;“, , expected” Why?

前端 未结 3 755
隐瞒了意图╮
隐瞒了意图╮ 2021-01-05 09:38

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

3条回答
  •  时光说笑
    2021-01-05 10:09

    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.

提交回复
热议问题