Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ThreadPreconditions {
- public static void checkOnMainThread() {
- if (BuildConfig.DEBUG) {
- if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
- throw new IllegalStateException("This method should be called from the Main Thread");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment