Example usage for android.os Bundle putLong

List of usage examples for android.os Bundle putLong

Introduction

In this page you can find the example usage for android.os Bundle putLong.

Prototype

public void putLong(@Nullable String key, long value) 

Source Link

Document

Inserts a long value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:com.example.crudcontent.fragment.EditCityFragment.java

public static EditCityFragment newInstance(long cityId) {
    EditCityFragment fragment = new EditCityFragment();
    Bundle args = new Bundle();
    args.putLong(ARG_CITY_ID, cityId);
    fragment.setArguments(args);//from   w ww . j  a  v  a  2  s . c o m
    return fragment;
}

From source file:com.customprogrammingsolutions.MediaStreamer.FavoritesDialog.java

public static FavoritesDialog newInstance(boolean addFromRecent, boolean addFromUser, boolean edit, String name,
        String url, long rowId, LoaderManager loader, LoaderManager.LoaderCallbacks<Cursor> callingActivity) {
    FavoritesDialog frag = new FavoritesDialog();
    Bundle args = new Bundle();
    args.putBoolean("addFromRecent", addFromRecent);
    args.putBoolean("addFromUser", addFromUser);
    args.putBoolean("edit", edit);
    args.putString("name", name);
    args.putString("url", url);
    args.putLong("rowId", rowId);
    frag.setArguments(args);//from w w w  .j  a va  2  s. com
    frag.loader = loader;
    frag.callingActivity = callingActivity;
    return frag;
}

From source file:com.dabay6.android.apps.carlog.ui.fuel.fragments.FuelHistoryDetailFragment.java

/**
 *
 * @param id//from  ww  w. j  a  va2 s  . c  o  m
 * @param mpg
 * @return
 */
public static FuelHistoryDetailFragment newInstance(final Long id, final Float mpg) {
    final Bundle arguments = new Bundle();
    final FuelHistoryDetailFragment fragment = new FuelHistoryDetailFragment();

    if (id != null) {
        arguments.putLong(PARAMS_ENTITY_ID, id);
    }

    if (mpg != null) {
        arguments.putFloat(PARAMS_MPG, mpg);
    }

    fragment.setArguments(arguments);

    return fragment;
}

From source file:com.facebook.LegacyTokenCacheTest.java

private static void putLong(String key, Bundle bundle) {
    bundle.putLong(key, random.nextLong());
}

From source file:com.coinblesk.client.ui.authview.AuthenticationDialog.java

public static AuthenticationDialog newInstance(Address address, Coin amount, String paymentRequestStr,
        boolean isPayerMode) {
    AuthenticationDialog frag = new AuthenticationDialog();
    Bundle args = new Bundle();
    args.putString(ARG_ADDRESS, address.toString());
    args.putLong(ARG_AMOUNT, amount.getValue());
    args.putString(ARG_PAYMENT_REQUEST, paymentRequestStr);
    args.putBoolean(ARG_IS_PAYER_MODE, isPayerMode);
    frag.setArguments(args);//from ww  w .j ava  2  s  .  c  o m
    return frag;
}

From source file:com.bydavy.card.receipts.fragments.ReceiptEditFragment.java

public static ReceiptEditFragment newInstance(long receiptId) {
    if (receiptId <= 0) {
        throw new IllegalArgumentException("receipt id must be > 0");
    }//from  w  w w. j  a  v  a 2  s  .  c om

    final ReceiptEditFragment f = new ReceiptEditFragment();

    final Bundle args = new Bundle();
    args.putLong(ARG_RECEIPT_ID, receiptId);
    f.setArguments(args);

    return f;
}

From source file:com.bluros.music.fragments.AlbumDetailFragment.java

public static AlbumDetailFragment newInstance(long id, boolean useTransition, String transitionName) {
    AlbumDetailFragment fragment = new AlbumDetailFragment();
    Bundle args = new Bundle();
    args.putLong(Constants.ALBUM_ID, id);
    args.putBoolean("transition", useTransition);
    if (useTransition)
        args.putString("transition_name", transitionName);
    fragment.setArguments(args);//from  ww  w  .  j a  v  a  2  s  .c o m
    return fragment;
}

From source file:com.andryr.musicplayer.fragments.PlaylistFragment.java

public static PlaylistFragment newInstance(Playlist playlist) {
    PlaylistFragment fragment = new PlaylistFragment();

    Bundle args = new Bundle();

    args.putLong(PARAM_PLAYLIST_ID, playlist.getId());
    args.putString(PARAM_PLAYLIST_NAME, playlist.getName());

    fragment.setArguments(args);/*w  ww .ja va2 s .  co  m*/
    return fragment;
}

From source file:com.bydavy.card.receipts.fragments.ReceiptFragment.java

public static ReceiptFragment newInstance(long receiptId) {
    if (receiptId <= 0) {
        throw new IllegalArgumentException("receipt id must be > 0");
    }/*from   ww  w .ja v  a2 s .com*/

    final ReceiptFragment f = new ReceiptFragment();

    final Bundle args = new Bundle();
    args.putLong(ARG_RECEIPT_ID, receiptId);
    f.setArguments(args);

    return f;
}

From source file:com.dmitrymalkovich.android.githubanalytics.traffic.TrafficFragment.java

public static TrafficFragment newInstance(long repositoryId) {
    TrafficFragment trafficFragment = new TrafficFragment();
    Bundle bundle = new Bundle();
    bundle.putLong(ARG_REPOSITORY_ID, repositoryId);
    trafficFragment.setArguments(bundle);
    return trafficFragment;
}