Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}