get String Array from a list of Bundle - Android android.os

Android examples for android.os:Bundle

Description

get String Array from a list of Bundle

Demo Code

import android.os.Bundle;
import android.os.Parcelable;
import java.util.ArrayList;

public class Main{

    public static String[] getStringArray(String key, Bundle... bundles) {
        if (bundles != null) {
            for (Bundle bundle : bundles) {
                if (bundle != null && bundle.containsKey(key)) {
                    return bundle.getStringArray(key);
                }/*w w w  .  ja v a  2  s.  c  o m*/
            }
        }
        return null;
    }

}

Related Tutorials