check if Bundle contains All keys - Android android.os

Android examples for android.os:Bundle

Description

check if Bundle contains All keys

Demo Code

import android.os.Bundle;

public class Main{

    public static boolean containsAll(Bundle bundle, String... keys) {

        if (bundle == null)
            return false;

        for (String key : keys) {
            if (!bundle.containsKey(key))
                return false;
        }/*from w  w w  .j a  v a 2  s  .  co m*/
        return true;
    }

}

Related Tutorials