I have an activity in my quiz application and I want to change its background every 5 seconds. How can I randomize the images in my drawable folder and make them the background images of my activity. Note: It is only a single activity.
Any help would be greatly appreciated. Thank you.
use
Handler
orTimertask
for changing background of activity in every 5 sec as:You can create an array of your drawables like this:
You can get them like this:
Now create random numbers:
Now set them as your background every 5 seconds(like in ρяσѕρєяs example).