How to check if current thread is not main thread

Looper.myLooper() == Looper.getMainLooper()

if this returns true, then you’re on the UI thread!

Leave a Comment