Android examples for android.os:Bundle
Puts string value to bundle if passed and creates empty Bundle if null passed.
import android.os.Bundle; import java.util.ArrayList; public class Main{ /**/*from w w w.j a v a2s . c o m*/ * Puts string value to bundle if passed and creates it if {@code null} passed. * * @param bundle to put into * @param key to to put under * @param value to put * @return bundle with the newly put value */ public static Bundle putString(Bundle bundle, String key, String value) { if (bundle == null) { bundle = new Bundle(); } bundle.putString(key, value); return bundle; } }