Example usage for android.os Bundle putLongArray

List of usage examples for android.os Bundle putLongArray

Introduction

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

Prototype

public void putLongArray(@Nullable String key, @Nullable long[] value) 

Source Link

Document

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

Usage

From source file:org.sufficientlysecure.keychain.remote.ui.SelectPublicKeyFragment.java

/**
 * Creates new instance of this fragment
 */// w w  w .  j  av a  2 s .co m
public static SelectPublicKeyFragment newInstance(long[] preselectedKeyIds) {
    SelectPublicKeyFragment frag = new SelectPublicKeyFragment();
    Bundle args = new Bundle();

    args.putLongArray(ARG_PRESELECTED_KEY_IDS, preselectedKeyIds);
    frag.setArguments(args);

    return frag;
}

From source file:org.thialfihar.android.apg.ui.dialog.DeleteKeyDialogFragment.java

/**
 * Creates new instance of this delete file dialog fragment
 */// w ww .  j av a  2  s  .co m
public static DeleteKeyDialogFragment newInstance(Messenger messenger, long[] keyRingRowIds) {
    DeleteKeyDialogFragment frag = new DeleteKeyDialogFragment();
    Bundle args = new Bundle();

    args.putParcelable(ARG_MESSENGER, messenger);
    args.putLongArray(ARG_DELETE_KEY_RING_ROW_IDS, keyRingRowIds);
    //We don't need the key type

    frag.setArguments(args);

    return frag;
}

From source file:me.diskstation.ammon.gpsrunner.ui.LineDetailsFragment.java

/**
 * Use this factory method to create a new instance of
 * this fragment using the provided parameters.
 *
 * @param runIds Array of IDs of runs to be displayed
 * @param mode mode of chart (velocity, altitude, ...)
 * @return A new instance of fragment LineDetailsFragment.
 *//*from   w  w w  .jav a2 s  .c  o  m*/

public static LineDetailsFragment newInstance(long[] runIds, int mode) {
    LineDetailsFragment fragment = new LineDetailsFragment();
    Bundle args = new Bundle();
    args.putLongArray(ARG_RUNIDS, runIds);
    args.putInt(ARG_MODE, mode);
    fragment.setArguments(args);
    return fragment;
}

From source file:com.facebook.LegacyTokenCacheTest.java

private static void putLongArray(String key, Bundle bundle) {
    int length = random.nextInt(50);
    long[] array = new long[length];
    for (int i = 0; i < length; i++) {
        array[i] = random.nextLong();//from   www.ja  v a2  s . c  o m
    }
    bundle.putLongArray(key, array);
}

From source file:de.dreier.mytargets.features.statistics.StatisticsFragment.java

public static StatisticsFragment newInstance(List<Long> roundIds, Target item, boolean animate) {
    StatisticsFragment fragment = new StatisticsFragment();
    Bundle bundle = new Bundle();
    bundle.putParcelable(StatisticsFragment.ARG_TARGET, Parcels.wrap(item));
    bundle.putLongArray(StatisticsFragment.ARG_ROUND_IDS, LongUtils.toArray(roundIds));
    bundle.putBoolean(StatisticsFragment.ARG_ANIMATE, animate);
    fragment.setArguments(bundle);/*from   w  ww. j  av  a  2  s  .  c o  m*/
    return fragment;
}

From source file:com.ultramegasoft.flavordex2.dialog.ExportDialog.java

/**
 * Show the dialog./*w  ww.j a  v a  2s  . c  o  m*/
 *
 * @param fm       The FragmentManager to use
 * @param entryIds The list of entry IDs to export
 */
public static void showDialog(@NonNull FragmentManager fm, @NonNull long[] entryIds) {
    final DialogFragment fragment = new ExportDialog();

    final Bundle args = new Bundle();
    args.putLongArray(ARG_ENTRY_IDS, entryIds);
    fragment.setArguments(args);

    fragment.show(fm, TAG);
}

From source file:org.projectbuendia.client.ui.dialogs.OrderExecutionDialogFragment.java

/** Creates a new instance and registers the given UI, if specified. */
public static OrderExecutionDialogFragment newInstance(Order order, Interval interval,
        List<DateTime> executionTimes) {
    Bundle args = new Bundle();
    args.putString("orderUuid", order.uuid);
    args.putString("instructions", order.instructions);
    args.putLong("orderStartMillis", order.start.getMillis());
    args.putLong("intervalStartMillis", interval.getStartMillis());
    args.putLong("intervalStopMillis", interval.getEndMillis());
    List<Long> millis = new ArrayList<>();
    for (DateTime dt : executionTimes) {
        if (interval.contains(dt)) {
            millis.add(dt.getMillis());/*from  w ww  .  j  av  a  2 s .  co m*/
        }
    }
    args.putLongArray("executionTimes", Utils.toArray(millis));
    // To avoid the possibility of confusion when the dialog is opened just
    // before midnight, save the current time for use as the encounter time later.
    DateTime encounterTime = DateTime.now();
    args.putLong("encounterTimeMillis", encounterTime.getMillis());
    args.putBoolean("editable", interval.contains(encounterTime));
    OrderExecutionDialogFragment f = new OrderExecutionDialogFragment();
    f.setArguments(args);
    return f;
}

From source file:org.sufficientlysecure.keychain.ui.BackupCodeFragment.java

public static BackupCodeFragment newInstance(long[] masterKeyIds, boolean exportSecret,
        boolean executeBackupOperation) {
    BackupCodeFragment frag = new BackupCodeFragment();

    Bundle args = new Bundle();
    args.putString(ARG_BACKUP_CODE, generateRandomBackupCode());
    args.putLongArray(ARG_MASTER_KEY_IDS, masterKeyIds);
    args.putBoolean(ARG_EXPORT_SECRET, exportSecret);
    args.putBoolean(ARG_EXECUTE_BACKUP_OPERATION, executeBackupOperation);
    frag.setArguments(args);/*from  ww w  .  j  a  v  a 2s  .  com*/

    return frag;
}

From source file:me.trashout.fragment.EventTrashSelectorFragment.java

public static EventTrashSelectorFragment newInstance(LatLng meetingPoint, ArrayList<Long> selectedTrashIdList) {
    Bundle b = new Bundle();
    b.putParcelable(BUNDLE_MEETING_POINT, meetingPoint);
    if (selectedTrashIdList != null && !selectedTrashIdList.isEmpty()) {
        long[] selectedTrashIdArray = new long[selectedTrashIdList.size()];
        for (int i = 0; i < selectedTrashIdArray.length; i++) {
            selectedTrashIdArray[i] = selectedTrashIdList.get(i);
        }/*  w ww . j av a  2  s  . co  m*/
        b.putLongArray(BUNDLE_SELECTED_TRASH_LIST, selectedTrashIdArray);
    }
    EventTrashSelectorFragment ret = new EventTrashSelectorFragment();
    ret.setArguments(b);
    return ret;
}

From source file:org.mariotaku.twidere.activity.AccountSelectorActivity.java

@Override
public void onSaveInstanceState(final Bundle outState) {
    outState.putLongArray(Constants.INTENT_KEY_IDS, ArrayUtils.fromList(mSelectedIds));
    super.onSaveInstanceState(outState);
}