Code example for Uri

Methods: getQueryParameter

0
        } 
        return value;
    } 
 
    private static long getLongParamFromUri(Uri uri, String paramName, long defaultValue) {
        final String value = uri.getQueryParameter(paramName);
        if (!TextUtils.isEmpty(value)) {
            try { 
                return Long.parseLong(value);
            } catch (NumberFormatException e) {
                // return default 
            } 
        } 
        return defaultValue;
    } 
 
    /** 
     * Create an {@link Intent} to launch an activity as the main entry point.  Existing activities 
     * will all be closed. 
     */ 
    public static Intent createRestartAppIntent(Context context, Class<? extends Activity> clazz) {