chikka.anddev
chikka.anddev

Reputation: 9629

android,working while thread


i am working on application in which i want to frequently change four imageviews images while thread is sleeping .


is it possible for doing ui changes while thread sleeps for two seconds.?


or there is another way to doing my purpose?

Upvotes: 0

Views: 260

Answers (2)

100rabh
100rabh

Reputation: 6186

chirag , You can invoke another new thread that does that(i.e. change your images) , this new child thread will be invoked just before you call Thread.sleep().By this approach you can be sure that both the threads are synchronous.

Upvotes: 0

UVM
UVM

Reputation: 9914

While thread is in sleep mode, you cannot do that.But your question is the answer here.you can update the UI with images for every 2 seconds.This is what effectively happens when you say Thread.sleep(2000) and after that period of time you can update your UI.

Upvotes: 1

Related Questions