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.vegnab.vegnab.MainVNActivity.java

public void goToVisitHeaderScreen(long visitID) {
    // swap VisitHeaderFragment in place of existing fragment
    if (LDebug.ON)
        Log.d(LOG_TAG, "About to go to VisitHeader");
    Bundle args = new Bundle();
    // visitID = 0 means new visit, not assigned or created yet
    args.putLong(VisitHeaderFragment.ARG_VISIT_ID, visitID);
    args.putInt(VisitHeaderFragment.ARG_SUBPLOT, 0); // start with dummy value, subplot 0
    VisitHeaderFragment visHdrFrag = VisitHeaderFragment.newInstance(args);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    // put the present fragment on the backstack so the user can navigate back to it
    // the tag is for the fragment now being added, not the one replaced
    transaction.replace(R.id.fragment_container, visHdrFrag, Tags.VISIT_HEADER);
    transaction.addToBackStack(null);//  w w w . jav a 2s.  c o  m
    transaction.commit();
}

From source file:com.tweetlanes.android.core.view.TweetFeedFragment.java

@Override
public void onSaveInstanceState(Bundle state) {
    super.onSaveInstanceState(state);

    if (mTwitterStatusIdWhenRefreshed != null)
        state.putLong("TwitterStatusIdWhenRefreshed", mTwitterStatusIdWhenRefreshed);

    if (mLastTwitterStatusIdSeen != null)
        state.putLong("LastTwitterStatusIdSeen", mLastTwitterStatusIdSeen);

    state.putInt("NewStatuses", mNewStatuses);
    state.putBoolean("HidingListHeading", mHidingListHeading);

    mSelectedItems.clear();/*w  w w.  j a  v a2  s .c  o  m*/
    android.util.SparseBooleanArray items = mTweetFeedListView.getRefreshableView().getCheckedItemPositions();
    for (int i = 0; i < items.size(); i++) {
        int key = items.keyAt(i);
        mTweetFeedListView.getRefreshableView().setItemChecked(key, false);
    }

}

From source file:com.vegnab.vegnab.MainVNActivity.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    // save the current subplot arguments in case we need to re-create the activity
    outState.putLong(ARG_SUBPLOT_TYPE_ID, mSubplotTypeId);
    outState.putLong(ARG_VISIT_ID, mVisitId);
    outState.putBoolean(ARG_CONNECTION_REQUESTED, mConnectionRequested);
    outState.putSerializable(ARG_PH_EXISTING_SET, mExistingPhCodes);
    outState.putLong(ARG_PURCH_REC_ID, mNewPurcRecId);
}

From source file:com.ichi2.anki.DeckPicker.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    super.onSaveInstanceState(savedInstanceState);
    savedInstanceState.putLong("mContextMenuDid", mContextMenuDid);
}

From source file:com.vegnab.vegnab.MainVNActivity.java

public void onVisitHeaderGoButtonClicked(long visitId) {
    mVisitId = visitId;/*  w w  w  .  j  av a2s.  co  m*/
    // swap DataEntryContainerFragment in place of existing fragment
    if (LDebug.ON)
        Log.d(LOG_TAG, "About to go to DataEntryContainer");
    FragmentManager fm = getSupportFragmentManager();
    Bundle args = new Bundle();
    if (LDebug.ON)
        Log.d(LOG_TAG, "In onVisitHeaderGoButtonClicked, about to putLong mVisitId=" + mVisitId);
    args.putLong(DataEntryContainerFragment.VISIT_ID, mVisitId);
    DataEntryContainerFragment dataEntryFrag = DataEntryContainerFragment.newInstance(args);
    FragmentTransaction transaction = fm.beginTransaction();
    // put the present fragment on the backstack so the user can navigate back to it
    // the tag is for the fragment now being added, not the one replaced

    transaction.replace(R.id.fragment_container, dataEntryFrag, Tags.DATA_SCREENS_CONTAINER);
    transaction.addToBackStack(null);
    transaction.commit();
    if (LDebug.ON)
        Log.d(LOG_TAG, "Call to DataEntryContainer complete");
}

From source file:com.nextgis.mobile.fragment.MapFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean(BUNDLE_KEY_IS_MEASURING, mRulerOverlay.isMeasuring());
    outState.putInt(KEY_MODE, mMode);/*from ww  w  .j  av a2 s .co m*/
    outState.putInt(BUNDLE_KEY_LAYER, null == mSelectedLayer ? Constants.NOT_FOUND : mSelectedLayer.getId());

    Feature feature = mEditLayerOverlay.getSelectedFeature();
    outState.putLong(BUNDLE_KEY_FEATURE_ID, null == feature ? Constants.NOT_FOUND : feature.getId());

    if (null != feature && feature.getGeometry() != null) {
        try {
            outState.putByteArray(BUNDLE_KEY_SAVED_FEATURE, feature.getGeometry().toBlob());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

From source file:com.facebook.AuthorizationClient.java

private void logAuthorizationMethodComplete(String method, String result, String errorMessage, String errorCode,
        Map<String, String> loggingExtras) {
    Bundle bundle;
    if (pendingRequest == null) {
        // We don't expect this to happen, but if it does, log an event for diagnostic purposes.
        bundle = newAuthorizationLoggingBundle("");
        bundle.putString(EVENT_PARAM_LOGIN_RESULT, Result.Code.ERROR.getLoggingValue());
        bundle.putString(EVENT_PARAM_ERROR_MESSAGE,
                "Unexpected call to logAuthorizationMethodComplete with null pendingRequest.");
    } else {/*from  w w  w .j  a  v  a  2  s  .  c o m*/
        bundle = newAuthorizationLoggingBundle(pendingRequest.getAuthId());
        if (result != null) {
            bundle.putString(EVENT_PARAM_LOGIN_RESULT, result);
        }
        if (errorMessage != null) {
            bundle.putString(EVENT_PARAM_ERROR_MESSAGE, errorMessage);
        }
        if (errorCode != null) {
            bundle.putString(EVENT_PARAM_ERROR_CODE, errorCode);
        }
        if (loggingExtras != null && !loggingExtras.isEmpty()) {
            JSONObject jsonObject = new JSONObject(loggingExtras);
            bundle.putString(EVENT_PARAM_EXTRAS, jsonObject.toString());
        }
    }
    bundle.putString(EVENT_PARAM_METHOD, method);
    bundle.putLong(EVENT_PARAM_TIMESTAMP, System.currentTimeMillis());

    getAppEventsLogger().logSdkEvent(EVENT_NAME_LOGIN_METHOD_COMPLETE, null, bundle);
}

From source file:com.vegnab.vegnab.MainVNActivity.java

public void onPlaceholderActionButtonClicked(Bundle args) {
    Bundle argsOut = new Bundle();
    if (LDebug.ON)
        Log.d(LOG_TAG, "In onPlaceholderActionButtonClicked");
    switch (args.getInt(EditPlaceholderFragment.BUTTON_KEY)) {
    case VNContract.PhActions.GO_TO_PICTURES: // go to the show/take/edit photos screen
        argsOut.putLong(PhPixGridFragment.ARG_PLACEHOLDER_ID,
                args.getLong(EditPlaceholderFragment.ARG_PLACEHOLDER_ID));
        PhPixGridFragment phGridFrag = PhPixGridFragment.newInstance(argsOut);
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        // put the present fragment on the backstack so the user can navigate back to it
        // the tag is for the fragment now being added, not the one replaced
        transaction.replace(R.id.fragment_container, phGridFrag, Tags.PLACEHOLDER_PIX_GRID);
        transaction.addToBackStack(null);
        transaction.commit();/* w w  w  .j  a  v  a2  s . com*/
        break;
    }
}

From source file:com.vegnab.vegnab.MainVNActivity.java

@Override
public void onNewItemButtonClicked(int screenToReturnTo, long visitId, long subplotId, boolean presenceOnly) {
    // presenceOnly is not used by Species Select, but passed along to Edit Species
    SelectSpeciesFragment selSppFrag = new SelectSpeciesFragment();
    Bundle args = new Bundle();

    // screenTag can serve both as this fn's switch and the tag name of the fragment instance
    // args.putString(SelectSpeciesFragment.ARG_TAG_ID, screenTag);

    // provide Visit and Subplot IDs, so selector can check for duplicate codes
    args.putLong(SelectSpeciesFragment.ARG_VISIT_ID, visitId);
    args.putLong(SelectSpeciesFragment.ARG_SUBPLOT_TYPE_ID, subplotId);
    // presenceOnly not used by SppSelect, but passed along to Edit Spp
    args.putBoolean(SelectSpeciesFragment.ARG_PRESENCE_ONLY_SUBPLOT, presenceOnly);
    args.putLong(SelectSpeciesFragment.ARG_PROJECT_ID, mProjectId);
    args.putLong(SelectSpeciesFragment.ARG_NAMER_ID, mNamerId);

    selSppFrag.setArguments(args);/*from w  w  w . j a v  a  2s  .c o m*/
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    // replace the fragment in the fragment container with this new fragment and
    // put the present fragment on the backstack so the user can navigate back to it
    // the tag is for the fragment now being added, not the one replaced
    transaction.replace(R.id.fragment_container, selSppFrag, Tags.SELECT_SPECIES);
    transaction.addToBackStack(null);
    transaction.commit();
}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openIncomingFriendships(final Activity activity, final long account_id) {
    if (activity == null)
        return;/*from   w ww .  j a  v  a  2  s  . c  om*/
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new IncomingFriendshipsFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_LEFT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_INCOMING_FRIENDSHIPS);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }
}