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.nononsenseapps.feeder.ui.ReaderFragment.java

/**
 * Convert an RssItem into a Bundle for use with Fragment Arguments
 *
 * @param rssItem to convert// w  w  w.  j a  v a 2s  . c  o m
 * @param bundle  may be null
 * @return bundle of rssItem plus id
 */
public static Bundle RssItemToBundle(FeedItemSQL rssItem, Bundle bundle) {
    if (bundle == null) {
        bundle = new Bundle();
    }
    bundle.putLong(ARG_ID, rssItem.id);
    bundle.putString(ARG_TITLE, rssItem.title);
    bundle.putString(ARG_DESCRIPTION, rssItem.description);
    bundle.putString(ARG_LINK, rssItem.link);
    bundle.putString(ARG_ENCLOSURE, rssItem.enclosurelink);
    bundle.putString(ARG_IMAGEURL, rssItem.imageurl);
    bundle.putString(ARG_FEEDTITLE, rssItem.feedtitle);
    bundle.putString(ARG_AUTHOR, rssItem.author);
    bundle.putString(ARG_DATE, rssItem.getPubDateString());
    return bundle;
}

From source file:bbct.android.common.activity.BaseballCardDetails.java

public static BaseballCardDetails getInstance(long id) {
    Bundle args = new Bundle();
    args.putLong(ID, id);
    BaseballCardDetails details = new BaseballCardDetails();
    details.setArguments(args);/* w w w. ja v a 2s  .co  m*/

    return details;
}

From source file:ca.rmen.android.scrumchatter.meeting.detail.MeetingFragment.java

/**
 * Add a new {@link MeetingFragment} to the given {@link FragmentManager}, for the given meeting.
 *///from  w w  w.  j  a  va  2  s .  c  o  m
public static void startMeeting(FragmentManager fragmentManager, Meeting meeting) {
    Bundle bundle = new Bundle(1);
    bundle.putLong(Meetings.EXTRA_MEETING_ID, meeting.getId());
    bundle.putSerializable(Meetings.EXTRA_MEETING_STATE, meeting.getState());
    MeetingFragment meetingFragment = new MeetingFragment();
    meetingFragment.setArguments(bundle);
    fragmentManager.beginTransaction().replace(R.id.meeting_fragment_placeholder, meetingFragment).commit();
}

From source file:com.freshdigitable.udonroad.UserInfoPagerFragment.java

public static UserInfoPagerFragment create(long userId) {
    final Bundle args = new Bundle();
    args.putLong(ARGS_USER_ID, userId);
    final UserInfoPagerFragment res = new UserInfoPagerFragment();
    res.setArguments(args);/*from   ww  w  .ja  v a 2s. co  m*/
    return res;
}

From source file:it.gulch.linuxday.android.fragments.TrackScheduleListFragment.java

public static TrackScheduleListFragment newInstance(Day day, Track track, long fromEventId) {
    Bundle args = new Bundle();
    args.putSerializable(ARG_DAY, day);/*  w w  w  .  j av a  2s . co  m*/
    args.putSerializable(ARG_TRACK, track);
    args.putLong(ARG_FROM_EVENT_ID, fromEventId);

    TrackScheduleListFragment f = new TrackScheduleListFragment();
    f.setArguments(args);

    return f;
}

From source file:com.google.android.apps.forscience.whistlepunk.EditNoteDialog.java

public static EditNoteDialog newInstance(Label label, GoosciLabelValue.LabelValue selectedValue,
        String timeText, long timestamp, String timeTextDescription) {
    EditNoteDialog dialog = new EditNoteDialog();
    Bundle args = new Bundle();
    args.putParcelable(KEY_SAVED_LABEL, label);
    args.putByteArray(KEY_SELECTED_VALUE, ProtoUtils.makeBlob(selectedValue));
    args.putString(KEY_SAVED_TIME_TEXT, timeText);
    args.putLong(KEY_SAVED_TIMESTAMP, timestamp);
    args.putString(KEY_SAVED_TIME_TEXT_DESCRIPTION, timeTextDescription);
    dialog.setArguments(args);/*  w  ww  .  j  a v a 2s  .  c  om*/
    return dialog;
}

From source file:com.appsimobile.appsii.hotspotmanager.HotspotSettingsFragment.java

/**
 * Creates an instance of the fragment with the arguments properly initialized
 *
 * @param hotspotId The hotspot id to edit
 * @param hotspotName The original name of the hotspot
 * @param defaultPageId The id of the default page
 *//* w  ww  .java  2 s  .  c  om*/
static HotspotSettingsFragment createEditInstance(long hotspotId, String hotspotName, long defaultPageId) {

    HotspotSettingsFragment result = new HotspotSettingsFragment();
    Bundle args = new Bundle();
    args.putLong("hotspot_id", hotspotId);
    args.putString("hotspot_name", hotspotName);
    args.putLong("default_page_id", defaultPageId);
    result.setArguments(args);
    return result;
}

From source file:Main.java

public static Bundle bundleCalendar(Calendar cal, long minDate) {
    Bundle args = new Bundle();
    if (cal == null)
        cal = Calendar.getInstance(Locale.getDefault());
    ;//w  ww  . j a  v a  2s.c o m
    args.putInt("year", cal.get(Calendar.YEAR));
    args.putInt("month", cal.get(Calendar.MONTH));
    args.putInt("day", cal.get(Calendar.DAY_OF_MONTH));
    args.putInt("hour", cal.get(Calendar.HOUR_OF_DAY));
    args.putInt("minute", cal.get(Calendar.MINUTE));
    args.putLong("minDate", minDate);
    return args;
}

From source file:com.linkedin.android.eventsapp.EventFragment.java

public static final EventFragment newInstance(Event event) {
    EventFragment f = new EventFragment();
    Bundle bdl = new Bundle();
    bdl.putString(EXTRA_EVENT_NAME, event.getEventName());
    bdl.putInt(EXTRA_PICTURE_ID, event.getImageResourceId());
    bdl.putString(EXTRA_EVENT_LOCATION, event.getEventLocation());
    bdl.putLong(EXTRA_EVENT_DATE, event.getEventDate());
    bdl.putBoolean(EXTRA_EVENT_ATTENDING, event.getIsAttending());
    bdl.putParcelableArray(EXTRA_EVENT_ATTENDEES, event.getEventAttendees());
    f.setArguments(bdl);/*from w ww . j  ava  2  s .  co  m*/
    return f;
}

From source file:com.metinkale.prayerapp.vakit.fragments.NotificationPrefs.java

public static NotificationPrefs create(Times t) {
    Bundle bdl = new Bundle();
    bdl.putLong("city", t.getID());
    NotificationPrefs frag = new NotificationPrefs();
    frag.setArguments(bdl);/*from w  w w .  ja v  a2 s  .  co m*/
    return frag;
}