how to select from resources randomly (R.drawable.xxxx)
问题 I want to display a random image from the bunch of images i have stored in res/drawable. The only technique that I know is to access a particular image if you know its resource id. Is there a way to access the images by using the filenames or something else (which can be constructed at runtime)? I want to randomly select an image at runtime. Any suggestions/ideas appreciated :) Thanks Chinmay 回答1: You can also access resources by name, which may be a viable approach to solving your problem if