how to select from resources randomly (R.drawable.xxxx)

前端 未结 8 922
终归单人心
终归单人心 2021-02-03 14:23

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 r

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-03 14:53

    I have never used the AssetManager, but would you be able to call getAssets on your Resources class, and then call list on the AssetManager with the location of your resources?

提交回复
热议问题