最終更新:2022-03-08 (火) 03:20:23 (774d)  

Handler.postDelayed
Top / Handler.postDelayed

Handler.postDelayed(Runnable r, long delayMillis) - Causes the Runnable r to be added to the message queue, to be run after the specified amount of time elapses.

3秒後に実行

  • new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
        @Override
        public void run() {
            // ここに3秒後に実行したい処理
        }
    }, 3000);

関連