code: public static Looper mineOrMain() {
          Looper looper = Looper.myLooper();
          return looper != null ? looper : Looper.getMainLooper();
      }
docs: Get this thread's Looper, if it's a Looper thread. Otherwise get the main thread Looper.