List of usage examples for android.os Bundle putLong
public void putLong(@Nullable String key, long value)
From source file:com.dabay6.android.apps.carlog.ui.vehicle.fragments.VehicleEditFragment.java
/** * Creates a new instance of {@link VehicleEditFragment}. * * @param id The vehicle id to be loaded. * * @return An instance of {@link VehicleEditFragment}. *///from w ww . j ava 2s . co m public static VehicleEditFragment newInstance(final Long id) { final Bundle bundle = new Bundle(); final VehicleEditFragment fragment = new VehicleEditFragment(); if (id != null) { bundle.putLong(PARAMS_ENTITY_ID, id); } fragment.setArguments(bundle); return fragment; }
From source file:com.facebook.LegacyTokenHelper.java
public static void putExpirationMilliseconds(Bundle bundle, long value) { Validate.notNull(bundle, "bundle"); bundle.putLong(EXPIRATION_DATE_KEY, value); }
From source file:com.facebook.LegacyTokenHelper.java
public static void putLastRefreshMilliseconds(Bundle bundle, long value) { Validate.notNull(bundle, "bundle"); bundle.putLong(LAST_REFRESH_DATE_KEY, value); }
From source file:com.frostwire.android.gui.dialogs.HandpickedTorrentDownloadDialog.java
public static HandpickedTorrentDownloadDialog newInstance(Context ctx, TorrentInfo tinfo, String magnetUri, long torrentFetcherDownloadTokenId) { ////from ww w . j a v a2 s. co m // ideas: - pre-selected file(s) to just check the one(s) // - passing a file path // - passing a byte[] to create the tinfo from. final HandpickedTorrentDownloadDialog dlg = new HandpickedTorrentDownloadDialog(); // this creates a bundle that gets passed to setArguments(). It's supposed to be ready // before the dialog is attached to the underlying activity, after we attach to it, then // we are able to use such Bundle to create our adapter. final TorrentFileEntryList torrentInfoList = getTorrentInfoList(tinfo.files()); boolean[] allChecked = new boolean[torrentInfoList.list.size()]; for (int i = 0; i < allChecked.length; i++) { allChecked[i] = true; } dlg.prepareArguments(R.drawable.download_icon, tinfo.name(), ctx.getString(R.string.pick_the_files_you_want_to_download_from_this_torrent), JsonUtils.toJson(torrentInfoList), SelectionMode.MULTIPLE_SELECTION); final Bundle arguments = dlg.getArguments(); arguments.putByteArray(BUNDLE_KEY_TORRENT_INFO_DATA, tinfo.bencode()); arguments.putString(BUNDLE_KEY_MAGNET_URI, magnetUri); arguments.putLong(BUNDLE_KEY_TORRENT_FETCHER_DOWNLOAD_TOKEN_ID, torrentFetcherDownloadTokenId); arguments.putBooleanArray(BUNDLE_KEY_CHECKED_OFFSETS, allChecked); return dlg; }
From source file:com.android.tv.dvr.ui.DvrUiHelper.java
/** * Shows the recording duration options dialog. *///from ww w. ja v a 2 s .com public static void showChannelRecordDurationOptions(Activity activity, Channel channel) { if (SoftPreconditions.checkNotNull(channel) == null) { return; } Bundle args = new Bundle(); args.putLong(DvrHalfSizedDialogFragment.KEY_CHANNEL_ID, channel.getId()); showDialogFragment(activity, new DvrChannelRecordDurationOptionDialogFragment(), args); }
From source file:com.android.tv.dvr.ui.DvrUiHelper.java
/** * Shows the conflict dialog for the channel watching. */// w w w . j a v a 2 s . c o m public static void showChannelWatchConflictDialog(MainActivity activity, Channel channel) { if (channel == null) { return; } Bundle args = new Bundle(); args.putLong(DvrHalfSizedDialogFragment.KEY_CHANNEL_ID, channel.getId()); showDialogFragment(activity, new DvrChannelWatchConflictDialogFragment(), args); }
From source file:com.android.tv.dvr.ui.DvrUiHelper.java
/** * Shows stop recording dialog./*ww w. j a va2 s.c o m*/ */ public static void showStopRecordingDialog(Activity activity, long channelId, int reason, HalfSizedDialogFragment.OnActionClickListener listener) { Bundle args = new Bundle(); args.putLong(DvrHalfSizedDialogFragment.KEY_CHANNEL_ID, channelId); args.putInt(DvrStopRecordingFragment.KEY_REASON, reason); DvrHalfSizedDialogFragment fragment = new DvrStopRecordingDialogFragment(); fragment.setOnActionClickListener(listener); showDialogFragment(activity, fragment, args); }
From source file:com.akop.bach.fragment.playstation.TrophiesFragment.java
public static TrophiesFragment newInstance(PsnAccount account, long titleId, boolean showGameTotals) { TrophiesFragment f = new TrophiesFragment(); Bundle args = new Bundle(); args.putParcelable("account", account); args.putLong("titleId", titleId); args.putBoolean("showGameTotals", showGameTotals); f.setArguments(args);//w w w.j a va2 s . c o m return f; }
From source file:com.rks.musicx.ui.fragments.ArtistFragment.java
public static ArtistFragment newInstance(Artist artist) { ArtistFragment fragment = new ArtistFragment(); Bundle args = new Bundle(); args.putLong(Constants.ARTIST_ARTIST_ID, artist.getId()); args.putString(Constants.ARTIST_NAME, artist.getName()); args.putInt(Constants.ARTIST_ALBUM_COUNT, artist.getAlbumCount()); args.putInt(Constants.ARTIST_TRACK_COUNT, artist.getTrackCount()); fragment.setArguments(args);//from w w w. j a v a 2s .c o m return fragment; }
From source file:com.chess.genesis.data.GameParser.java
public static Bundle parse(final JSONObject data) { final Bundle game = new Bundle(); try {/*w w w . j a va2 s . co m*/ game.putInt("gametype", Enums.GameType(data.optString("gametype", "genesis"))); } catch (final RuntimeException e) { game.putInt("gametype", Enums.GENESIS_CHESS); } try { game.putInt("opponent", Enums.OpponentType(data.optString("opponent", "human"))); } catch (final RuntimeException e) { game.putInt("opponent", Enums.HUMAN_OPPONENT); } game.putString("name", data.optString("name", "untitled")); game.putLong("ctime", data.optLong("ctime", System.currentTimeMillis())); game.putLong("stime", data.optLong("stime", System.currentTimeMillis())); final GamePosition pos = parsePosition(data.optString("history", " "), game.getInt("gametype")); game.putString("history", pos.history); game.putString("zfen", pos.zfen); return game; }