ensure Contains Key or throw exception - Android android.os

Android examples for android.os:Bundle

Description

ensure Contains Key or throw exception

Demo Code

import android.os.Bundle;

public class Main{

    private static void ensureContainsKey(Bundle b, String key)
            throws Exception {
        if (!b.containsKey(key)) {
            throw new Exception(
                    "Missing required key: " + key);
        }/*from  w w w .ja  va 2 s .  c o m*/
    }

}

Related Tutorials