[Solved] How can resolve R in Android?

The R.java file should be automatically generated by Android. Try the following: If you are using Eclipse try “project clean” to regenerate the file. Try to fix all errors not related to the R file and then retry the “project clean” option. Other errors (e.g. your xml layout files) can “stall” a new build of … Read more

[Solved] Get resources images from variable

You can define Context inner class MonsterAdapter public class MonsterAdapter extends BaseAdapter{ Context mContext; public MonsterAdapter(Context context, …){ this.mContext = context; … } } then you can use imageView.setImageResource(mContext.getResources().getIdentifier(variableValue, “drawable”, getPackageName())); solved Get resources images from variable