get String value from Bundle by key - Android android.os

Android examples for android.os:Bundle

Description

get String value from Bundle by key

Demo Code

import android.os.Bundle;

public class Main{

    public static String getString(Bundle b, String key) {
        String ret = "";
        if (b != null) {
            ret = b.getString(key);/*from   w ww  .  ja v  a2s.  c  om*/
            if (ret == null) {
                ret = "";
            }
        }
        return ret;
    }
}

Related Tutorials