get String from Bundle, return null if not found - Android android.os

Android examples for android.os:Bundle

Description

get String from Bundle, return null if not found

Demo Code

import android.os.Bundle;
import android.text.TextUtils;
import java.io.Serializable;

public class Main{

    public static String getString(Bundle arguments, String key) {
        if (arguments.containsKey(key)) {
            return arguments.getString(key);
        } else {// ww w  .  j a  va 2  s  .com
            return null;
        }
    }

}

Related Tutorials