Tuesday, April 18, 2023

Simple way to use postDelayed() correctly in Android Studio


final Handler handler = new Handler();

handler.postDelayed(new Runnable() {
    @Override
    public void run() {
        // Write whatever to want to do after delay specified (1 sec)
        Log.d("Handler", "Running Handler");
    }
}, 1000);

No comments:

Post a Comment