Full source code to execute a piece of code by passing a Runnable to a Handler’s postDelayed method. We will also make this Runnable repeat itself and stop it on button click by calling removeCallbacks on our Handler activity_main.xml MainActivity.java