java - How to check if current thread is not main thread -


I need to check that running a certain part of the thread is the main (UI) thread running code. How can I get it?

  Looper Mackleper () == Looper.getMainLooper ()   

If this return is correct, then you are on the UI thread!

Comments