Skip to content Skip to sidebar Skip to footer

Java Runonuithread And Thread.sleep

I have this method from a separate class wherein when the call ends, the color of my ImageView changes from red to white. Sample code below: public void endOfCall(){ ((Activit

Solution 1:

Use Handler instead of putting thread to sleep.

So instead of your if(true) {.....} try this:

Handlerh=newHandler();
h.postDelayed(newRunnable() {
    @Overridepublicvoidrun() {
        //new intent here
    }
}, 10000);

Post a Comment for "Java Runonuithread And Thread.sleep"