【发布时间】:2014-01-23 03:41:49
【问题描述】:
我正在编写带有 Eclipse 中几个活动的 android 应用程序。我在 MainActivity 中有一个对象,我希望它在所有其他活动中可见,所以我做到了:
public static cPlayer player = new cPlayer();
当我这样做时:
switch (MainActivity.player.getName())
我有错误:
Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted
它想将 JRE 更改为 1.7。所以我这样做。但在那之后我又犯了一个错误:
Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
但是在那之后,之前的问题又回来了。
请帮忙。
【问题讨论】: