Search code examples
androidhandlerandroid-handlerpostdelayed

Handler - PostDelayed method "break" the rest (block) of code?


If a code is within Android's postdelayed method, and just below it is more code, does postdelayed lock everything?

Example:

final Handler handler = new Handler ();
            handler.postDelayed (new Runnable () {
                @Override
                public void run () {
                // do something here after 1800millis
                }
            }, 1800);

// something to show on the screen here, this only after 1800millis also?

Solution

  • Only code that is within the postDelayed will be delayed. It will not block anything that comes after.