static public Intent convert(final Intent intent) {
        if (intent == null) {
            return null;
        }

        if (!ACTION_VIEW.equals(intent.getAction())) {
            return null;
        }

        Uri data = intent.getData();
        if (data == null) {
            return null;
        }

        if (TextUtils.isEmpty(data.getHost()) || TextUtils.isEmpty(data.getScheme())) {
            String host = data.getHost();
            if (TextUtils.isEmpty(host)) {
                host = HOST_DEFAULT;
            }
            String scheme = data.getScheme();
            if (TextUtils.isEmpty(scheme)) {
                scheme = PROTOCOL_HTTPS;
            }
            String prefix = scheme + "://" + host;

            String path = data.getPath();
            if (!TextUtils.isEmpty(path)) {
                if (path.charAt(0) == '/') {
                    data = Uri.parse(prefix + path);
                } else {
                    data = Uri.parse(prefix + '/' + path);
                }
            } else {
                data = Uri.parse(prefix);
            }
            intent.setData(data);
        }

        return getIntentForURI(data);
    }
Convert global view intent one into one that can be possibly opened
inside the current application.

@param intent
@return converted intent or null if non-application specific
app/src/main/java/com/github/pockethub/android/ui/user/UriLauncherActivity.java