What is the difference between View.postDelayed() and Handler.postDelayed() on the main thread? What is the difference between View.postDelayed() and Handler.postDelayed() on the main thread? multithreading multithreading

What is the difference between View.postDelayed() and Handler.postDelayed() on the main thread?


From the source, View.postDelayed() is simply using Handler.postDelayed() on an internal handler so there is no difference.

foo() may leak the Activity, you should use View.removeCallbacks() to minimize this chance.