create Bundle from key and boolean - Android Android OS

Android examples for Android OS:Bundle Key

Description

create Bundle from key and boolean

Demo Code


//package com.book2s;
import android.os.Bundle;
import android.os.Parcelable;

public class Main {
    public static Bundle createBundle(final String key, final boolean value) {
        final Bundle bundle = new Bundle();
        bundle.putBoolean(key, value);/*  ww  w .j  ava  2s. c  o m*/
        return bundle;
    }

    public static Bundle createBundle(final String key, final String value) {
        final Bundle bundle = new Bundle();
        bundle.putString(key, value);
        return bundle;
    }

    public static Bundle createBundle(final String key,
            final Parcelable value) {
        final Bundle bundle = new Bundle();
        bundle.putParcelable(key, value);
        return bundle;
    }
}

Related Tutorials