lundi 23 novembre 2015

How do I randomly display a set of backgrounds?

I have five different backgrounds that I want to randomly display everytime the page reloads. I'm still fairly new to java and not sure how to do this using R.drawable....

I was thinking I would have to generate a random number, use that number as part of a string and pass the string to the setBackgroundResource method, but that doesn't seem to fly.

Any help would be greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire