Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse R不能解析为变量为什么?_Eclipse_Android Resources - Fatal编程技术网

Eclipse R不能解析为变量为什么?

Eclipse R不能解析为变量为什么?,eclipse,android-resources,Eclipse,Android Resources,我有这个 public GamePanel(Context context, Game game,int ScreenWidth,int Screenheigt) { super(context); getHolder().addCallback(this); this.game = game; thread = new MainThread(getHolder(),this); background = new Background(BitmapFact

我有这个

public GamePanel(Context context, Game game,int ScreenWidth,int Screenheigt) {
    super(context);
    getHolder().addCallback(this);
    this.game = game;
    thread = new MainThread(getHolder(),this);
    background = new Background(BitmapFactory.decodeResource(getResources(), R.drawable.game_fon), ScreenWidth, this);
    BM = new Barriermanager(BitmapFactory.decodeResource(getResources(), R.drawable.barier), this);
    BM.setScreen(ScreenWidth, Screenheigt);
    ship = new Ship(BitmapFactory.decodeResource(getResources(), R.drawable.player), 100, 0, ScreenWidth, Screenheigt);
    coin = new Bonus(BitmapFactory.decodeResource(getResources(), R.drawable.bonus), -200,-200);
    ArrayList<Bitmap> animation = new ArrayList<Bitmap>();
    animation.add(BitmapFactory.decodeResource(getResources(), R.drawable.boom1));
    animation.add(BitmapFactory.decodeResource(getResources(), R.drawable.boom2));
    animation.add(BitmapFactory.decodeResource(getResources(), R.drawable.boom3));
    animation.add(BitmapFactory.decodeResource(getResources(), R.drawable.boom4));
    ship.setBoomAnimation(animation);
公共游戏面板(上下文上下文、游戏、int屏幕宽度、int屏幕高度){
超级(上下文);
getHolder().addCallback(此);
这个游戏=游戏;
线程=新的主线程(getHolder(),this);
背景=新背景(BitmapFactory.decodeResource(getResources(),R.drawable.game_fon),屏幕宽度,此);
BM=新的Barriermanager(BitmapFactory.decodeResource(getResources(),R.drawable.barier),this);
BM.设置屏幕(屏幕宽度、屏幕高度);
ship=newship(BitmapFactory.decodeResource(getResources(),R.drawable.player),100,0,ScreenWidth,Screenheigt);
coin=新奖金(BitmapFactory.decodeResource(getResources(),R.drawable.Bonus),-200,-200);
ArrayList动画=新建ArrayList();
add(BitmapFactory.decodeResource(getResources(),R.drawable.boom1));
add(BitmapFactory.decodeResource(getResources(),R.drawable.boom2));
add(BitmapFactory.decodeResource(getResources(),R.drawable.boom3));
add(BitmapFactory.decodeResource(getResources(),R.drawable.boom4));
船舶操纵(动画);

请帮助!无法将“R”解析为变量

您能提供更多代码吗,例如调用add方法的位置,以及生成的异常和提供的堆栈跟踪?公共游戏面板(上下文上下文,游戏游戏,int ScreenWidth,int Screenheigt){super(上下文);getHolder().addCallback(此);this.game=game;thread=new main thread(getHolder(),this);background=new background(BitmapFactory.decodeResource(getResources(),R.drawable.game_fon),ScreenWidth,this);BM=newbarriermanager(BitmapFactory.decodeResource(getResources(),R.drawable.barier),this);BM.setscreenwidth,Screenheigt=new ship(BitmapFactory.decodeResource(getResources(),R.drawable.player),100,0,ScreenWidth,Screenheigt);coin=新奖金(BitmapFactory.decodeResource(getResources(),R.drawable.Bonus),-200,-200);ArrayList动画=新ArrayList();如果您使用正确格式的代码编辑了原始帖子,这将非常有用…“R”是“android”软件包中的一个类。您的项目设置似乎有错误。