Zizou
Zizou

Reputation: 1951

How to use a timer?

I want to change the background, but I want to change it using a timer. for example in the morning I have a background and evening I have another background. But I don't know what to use in Android. and if you have an example to follow. any idea?

Upvotes: 0

Views: 98

Answers (1)

bjrne
bjrne

Reputation: 375

Just to make sure I understand what you mean, do you want to:

-Change the background after a time or
-change the background at different daytimes?

To accomplish the second one, I would set a switch into your OnCreate() method (or any other place e.g. OnResume(), a button click) that looks for the Time with

Time t = new Time();  
t.setToNow();

and then decides what Image to use

Upvotes: 1

Related Questions