Java tutorial
//package com.java2s; //License from project: Apache License import android.support.annotation.NonNull; import android.os.Bundle; public class Main { @NonNull public static String getString(final Bundle bundle, @NonNull final String key, @NonNull final String defaultValue) { final String res = bundle.getString(key); if (res != null) { return res; } return defaultValue; } }