public static boolean isMainThread(){
  return sIsMainThread.get();
}

public static boolean isMainThread ( ) { return sIsMainThread . get ( ) ; }
returns true if the method is run on the main android thread .
