I’m setting an Image Resource for an ImageView. Depending on the condition, the ImageView will display an specific image.
I’m using this code:
exerciseImage.setImageResource(R.drawable.treadmill);
At the first two condition(ifs), this line doesn’t show any error. While the next Ifs, errors occur. I can guarantee that my images are at my, drawable folder. Because the first to ifs doesn’t show any error. When I try to use the intellisense, the desired images doesn’t show up. Some are there but most of them are not. I really don’t know what the problem is because all images are at my drawablefolder. Any ideas?
I’m getting and error. “Cannot be resolved or is not a field”

Might be the
R.javafile has not been generated in your project.Check if you have error in any of your xml files and next check if your images are having valid names.
and later build and clean the project. If the problem still exists try checking if you have any import statement with something like
import android.R;delete it and again build and clean the project