call a method after a delay in android

‮al.www‬utturi.com
call a method after a delay in android

android execute code after 3 seconds

// delay execute function in android
// android execute a function after a few seconds

new Timer().schedule(new TimerTask() {          
    @Override
    public void run() {
        // this code will be executed after 2 seconds       
    }
}, 2000);
Created Time:2017-09-04 21:25:13  Author:lautturi