Android 关于从mipmap文件夹获取位图时的错误

Android 关于从mipmap文件夹获取位图时的错误,android,Android,我已经在我的VisualStudio中包含了演示项目。但它显示了我在以下陈述中的错误。我也将图像和过去的内容复制到了mipmap中。 请任何人检查一下是什么错误,并指导我。先谢谢你 Bitmap fuelbar= BitmapFactory.decodeResource(getResources(), );//Bitmap image gets the fuel image from the resources folder Bitmap blastCraft = BitmapFac

我已经在我的VisualStudio中包含了演示项目。但它显示了我在以下陈述中的错误。我也将图像和过去的内容复制到了mipmap中。 请任何人检查一下是什么错误,并指导我。先谢谢你

  Bitmap fuelbar= BitmapFactory.decodeResource(getResources(), );//Bitmap image gets the fuel image from the resources folder
    Bitmap blastCraft = BitmapFactory.decodeResource(getResources(), R.drawable.explosion);//Bitmap image gets the explosion image from the resources folder
   Bitmap thruster = BitmapFactory.decodeResource(getResources(), R.drawable.thruster);//Bitmap image gets the small thruster image from the resources folder
        Bitmap main_flame = BitmapFactory.decodeResource(getResources(), R.drawable.main_flame);//Bitmap image gets the main flame image from the resources folder

放置位图的文件夹是什么?可绘制或mipmap或两者

如果放置在mipmap文件夹中,则应将代码更改为:

Bitmap blastCraft = BitmapFactory.decodeResource(getResources(), R.mipmap.explosion);//Bitmap image gets the explosion image from the resources folder
Bitmap thruster = BitmapFactory.decodeResource(getResources(), R.mipmap.thruster);//Bitmap image gets the small thruster image from the resources folder
Bitmap main_flame = BitmapFactory.decodeResource(getResources(), R.mipmap.main_flame);//Bitmap image gets the main flame image from the resources folder

无法解决R.drawable.Purcheri认为错误的原因是以前我给了项目名称com.abc,现在我给了com.xyz。你这样认为吗?@J.维亚斯:是的。。您已更改包名,这就是为什么
R
文件未生成。。!!您可以使用包名
com.xyz
创建一个新项目,或者只需删除
build
文件夹并尝试清理和重建项目。。再加上从java文件中删除旧的
R
导入。。!!谢谢你的朋友给我回复。请告诉我在eclipse构建文件夹中的什么地方可以找到它