Android Delay Execution

April 14, 2019
Timer timer = new Timer();

timer.schedule(new TimerTask() {
    @Override
    public void run() {
        // do something in background thread

        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                // do something in main/ui thread
            }
        });
    }
}, 1000);
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.