Java tutorial
//package com.java2s; import android.net.Uri; import android.text.TextUtils; public class Main { public static String getParam(Uri uri, String key, String defaultValue) { if (uri == null) { return defaultValue; } String value = null; try { value = uri.getQueryParameter(key); } catch (Exception e) { } if (TextUtils.isEmpty(value)) { value = defaultValue; } return value; } }