当我尝试编译此代码时,请告诉我如何解决该代码的问题错误:注释值不是允许的类型显示在第9行
这是代码
public class SettingsFragment extends Fragment {
public static final String APP_LINK = "https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID;
static final String KEY_COLOR_1 = "COLOR_1";
static final String KEY_COLOR_2 = "COLOR_2";
static final String KEY_COLOR_3 = "COLOR_3";
static final String KEY_COLOR_4 = "COLOR_4";
static final String KEY_COLOR_5 = "COLOR_5";
@BindView ({R2.id.view_1, R2.id.view_2, R2.id.view_3, R2.id.view_4, R2.id.view_5})
View[] views;
private SharedPreferences preferences;
public static SettingsFragment instance() {
return new SettingsFragment();
}
最佳答案
当它的multipme使用bindviews而不是bindview时
R.id.view_1 不是 R2.id.view_1
我不确定 R2 是什么。
像这样使用它:
@BindViews({R.id.view_1, R.id.view_2, R.id.view_3, R.id.view_4, R.id.view_5 })
List<View> myViews;
关于java - 注释值不是允许的类型 rrror : illegal initializer for int,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48564321/