Guest User

Untitled

a guest
Dec 11th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. public class ThreadPreconditions {
  2.  
  3. public static void checkOnMainThread() {
  4. if (BuildConfig.DEBUG) {
  5. if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
  6. throw new IllegalStateException("This method should be called from the Main Thread");
  7. }
  8. }
  9. }
  10. }
Add Comment
Please, Sign In to add comment