Android programming, a little issue.

前端 未结 3 1766
眼角桃花
眼角桃花 2021-01-26 06:58

I\'m getting the red squiggle under a parenthesis this time, telling me \"insert \"EnumBody\" to complete EnumDeclaration\"

It is happening on the last line of this cod

3条回答
  •  温柔的废话
    2021-01-26 07:31

    It seems to me that the method onCreate has been closed to early, the spinner.setOnItemSelectedListener should be in that and the defined inner clsses outside of the method. The spinner.setOnItemSelectedListener just floats around in the middle of the class, maybe it should be in the onCreate method. (which might be valid syntax, but I'm not sure if that's the thing what you want to achieve)

    The statement might be handled like a initialization Block in Java, even without parenthesis. (but I'm not 100% sure) See: http://jpz-log.info/archives/2009/03/25/initialization-blocks-in-java/

提交回复
热议问题