[Solved] How can resolve R in Android?

[ad_1] 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 … Read more

[Solved] Get resources images from variable

[ad_1] 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())); [ad_2] solved Get resources images from variable