public static boolean currentThreadIsUiThread() {
        return Thread.currentThread() == Looper.getMainLooper().getThread();
    }
Tries its best to return the size of a view. Returns null otherwise.
Sometimes it is only possible to return width OR height. In this case the other parameter is set to 0.

@return Pair where first is width in pixel and second is height in pixel
main/src/main/java/cgeo/geocaching/ui/ViewUtils.java