Handler handler = new Handler(); Runnable runnable = new Runnable() { @Override public void run() { // This code will run after a delay of 1000 milliseconds (1 second) } }; handler.postDelayed(runnable, 1000);In this example, we create a new Handler object and a Runnable object that will be executed after a delay of 1000 milliseconds. We then use the postDelayed() method of the Handler object to send the Runnable object to the Handler after the specified delay. The android.os.Handler class is part of the Android OS package library, which is included in all Android applications by default.