Puts long value into a bundle. If bundle is null new empty Bundle will be created. - Android android.os

Android examples for android.os:Bundle

Description

Puts long value into a bundle. If bundle is null new empty Bundle will be created.

Demo Code

import android.os.Bundle;
import java.util.ArrayList;

public class Main{

    /**/*from w  ww. j  a v a 2s .  c  o m*/
     * Puts long value into a bundle. If bundle is null new one will be created.
     *
     * @param bundle to put into
     * @param key    to put under
     * @param value  to put
     * @return bundle with the value
     */
    public static Bundle putLong(Bundle bundle, String key, long value) {
        if (bundle == null) {
            bundle = new Bundle();
        }
        bundle.putLong(key, value);
        return bundle;
    }

}

Related Tutorials