android - Button press after a delay -


hi writing first android app , want perform click after few seconds. how can that?

    public void computermove(boolean butn){     if(clickone){         if(five.isenabled()){             five.performclick();         }     } 

to perform onclick post delayed message handler, specifying as

handler myhandler = new handler(); myhandler.postdelayed(mmyrunnable, 5000); 

and call runnable

private runnable mmyrunnable = new runnable() {     @override     public void run()     {        //call performclick  here     }  }; 

in onclick function called after 5 seconds/5000 milliseconds.

see more info @ handler postdelayed


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -