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.github.chenxiaolong.dualbootpatcher.patcher.PatchFileFragment.java

/**
 * {@inheritDoc}//from  w  ww  .j a  v  a 2s .  co m
 */
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putString(EXTRA_SELECTED_PATCHER_ID, mSelectedPatcherId);
    outState.putParcelable(EXTRA_SELECTED_INPUT_URI, mSelectedInputUri);
    outState.putParcelable(EXTRA_SELECTED_OUTPUT_URI, mSelectedOutputUri);
    outState.putString(EXTRA_SELECTED_INPUT_FILE_NAME, mSelectedInputFileName);
    outState.putLong(EXTRA_SELECTED_INPUT_FILE_SIZE, mSelectedInputFileSize);
    outState.putInt(EXTRA_SELECTED_TASK_ID, mSelectedTaskId);
    outState.putParcelable(EXTRA_SELECTED_DEVICE, mSelectedDevice);
    outState.putString(EXTRA_SELECTED_ROM_ID, mSelectedRomId);
    outState.putBoolean(EXTRA_QUERYING_METADATA, mQueryingMetadata);
}

From source file:com.pseudosudostudios.jdd.activities.GameActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    if (bg.tiles == null || bg.tiles[2][2] == null || bg == null) {
        super.onSaveInstanceState(outState);
        return;/*from w  w w.  j  ava  2s.  c  om*/
    }
    for (int r = 0; r < bg.tiles.length; r++)
        for (int c = 0; c < bg.tiles[r].length; c++) {
            outState.putIntArray(onSaveBaseString + r + c, bg.tiles[r][c].toIntArray());
            if (bg.sol1 != null && bg.sol1[r][c] != null)
                outState.putIntArray(onSaveSolution + r + c, bg.sol1[r][c].toIntArray());
        }
    try {
        outState.putIntArray(onSaveCeterTile, bg.getCenterTile().toIntArray());
    } catch (NullPointerException e) {
        outState.putIntArray(onSaveCeterTile, bg.tiles[1][1].toIntArray());
    }
    outState.putInt(bundleGameColors, Grid.numberOfColors);
    outState.putInt(jsonTileSize, Grid.tileSize);
    outState.putString(onSaveBaseString, bg.getDifficulty().toString());
    outState.putInt(bundleGameColors, Grid.numberOfColors);
    outState.putLong(onSaveTime, bg.getTimeSinceStart());
}

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

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putInt(KEY_SELECTED_SENSOR_INDEX, mSelectedSensorIndex);
    outState.putBoolean(KEY_TIMESTAMP_EDIT_UI_VISIBLE,
            getChildFragmentManager().findFragmentByTag(EditTimeDialog.TAG) != null);
    outState.putLong(KEY_EXTERNAL_AXIS_MINIMUM, mExternalAxis.getXMin());
    outState.putLong(KEY_EXTERNAL_AXIS_MAXIMUM, mExternalAxis.getXMax());
    outState.putLong(KEY_RUN_REVIEW_OVERLAY_TIMESTAMP, mRunReviewOverlay.getTimestamp());
    outState.putBoolean(KEY_STATS_OVERLAY_VISIBLE, mShowStatsOverlay);
}

From source file:com.android.calendar.AllInOneActivity.java

@Override
public void onSaveInstanceState(Bundle outState) {
    mOnSaveInstanceStateCalled = true;/*from  w  w w  . ja v a2s. c  om*/
    super.onSaveInstanceState(outState);
    outState.putLong(BUNDLE_KEY_RESTORE_TIME, mController.getTime());
    outState.putInt(BUNDLE_KEY_RESTORE_VIEW, mCurrentView);
    if (mCurrentView == ViewType.EDIT) {
        outState.putLong(BUNDLE_KEY_EVENT_ID, mController.getEventId());
    } else if (mCurrentView == ViewType.AGENDA) {
        FragmentManager fm = getFragmentManager();
        Fragment f = fm.findFragmentById(R.id.main_pane);
        if (f instanceof AgendaFragment) {
            outState.putLong(BUNDLE_KEY_EVENT_ID, ((AgendaFragment) f).getLastShowEventId());
        }
    }
    outState.putBoolean(BUNDLE_KEY_CHECK_ACCOUNTS, mCheckForAccounts);
}

From source file:com.nextgis.ngm_clink_monitoring.fragments.CreateObjectFragment.java

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

    if (null != mLineRemoteId) {
        outState.putLong(FoclConstants.FOCL_STRUCT_REMOTE_ID, mLineRemoteId);
    }//  w  ww . ja  v  a2  s  .  c om

    outState.putInt(FoclConstants.FOCL_STRUCT_LAYER_TYPE, mFoclStructLayerType);

    if (null != mTempPhotoPath) {
        outState.putString(FoclConstants.TEMP_PHOTO_PATH, mTempPhotoPath);
    }

    if (null != mAccurateLocation) {
        outState.putParcelable(FoclConstants.ACCURATE_LOCATION, mAccurateLocation);
    }

    if (null != mAccurateLocationTaker) {
        outState.putBoolean(FoclConstants.IS_ACCURATE_TAKING, mAccurateLocationTaker.isTaking());
    }
}

From source file:com.hippo.ehviewer.ui.scene.GalleryListScene.java

@Override
public void onApplySearch(String query) {
    if (null == mUrlBuilder || null == mHelper || null == mSearchLayout) {
        return;/*from   w w w .j  a  va 2  s.co m*/
    }

    if (mState == STATE_SEARCH || mState == STATE_SEARCH_SHOW_LIST) {
        if (mSearchLayout.isSpecifyGallery()) {
            int index = query.indexOf(' ');
            if (index <= 0 || index >= query.length() - 1) {
                showTip(R.string.error_invalid_specify_gallery, LENGTH_LONG);
                return;
            }

            long gid;
            String token;
            try {
                gid = Long.parseLong(query.substring(0, index));
            } catch (NumberFormatException e) {
                showTip(R.string.error_invalid_specify_gallery, LENGTH_LONG);
                return;
            }
            token = query.substring(index + 1);

            Bundle args = new Bundle();
            args.putString(GalleryDetailScene.KEY_ACTION, GalleryDetailScene.ACTION_GID_TOKEN);
            args.putLong(GalleryDetailScene.KEY_GID, gid);
            args.putString(GalleryDetailScene.KEY_TOKEN, token);
            startScene(new Announcer(GalleryDetailScene.class).setArgs(args));
            return;
        } else {
            try {
                mSearchLayout.formatListUrlBuilder(mUrlBuilder, query);
            } catch (EhException e) {
                showTip(e.getMessage(), LENGTH_LONG);
                return;
            }
        }
    } else {
        mUrlBuilder.reset();
        mUrlBuilder.setKeyword(query);
    }
    onUpdateUrlBuilder();
    mHelper.refresh();
    setState(STATE_NORMAL);
}

From source file:com.android.music.TrackBrowserFragment.java

public void onSaveInstanceState(Bundle outcicle) {
    // need to store the selected item so we don't lose it in case
    // of an orientation switch. Otherwise we could lose it while
    // in the middle of specifying a playlist to add the item to.
    outcicle.putLong("selectedtrack", mSelectedId);
    outcicle.putString("artist", mArtistId);
    outcicle.putString("album", mAlbumId);
    outcicle.putString("playlist", mPlaylist);
    outcicle.putString("genre", mGenre);
    outcicle.putBoolean("editmode", mEditMode);
    super.onSaveInstanceState(outcicle);
}

From source file:com.android.mail.ui.AnimatedAdapter.java

public void onSaveInstanceState(Bundle outState) {
    long[] lastDeleting = new long[mLastDeletingItems.size()];
    for (int i = 0; i < lastDeleting.length; i++) {
        lastDeleting[i] = mLastDeletingItems.get(i);
    }//  www .j  av  a2s.  co  m
    outState.putLongArray(LAST_DELETING_ITEMS, lastDeleting);
    if (hasLeaveBehinds()) {
        if (mLastLeaveBehind != -1) {
            outState.putParcelable(LEAVE_BEHIND_ITEM_DATA,
                    mLeaveBehindItems.get(mLastLeaveBehind).getLeaveBehindData());
            outState.putLong(LEAVE_BEHIND_ITEM_ID, mLastLeaveBehind);
        }
        for (LeaveBehindItem item : mLeaveBehindItems.values()) {
            if (mLastLeaveBehind == -1 || item.getData().id != mLastLeaveBehind) {
                item.commit();
            }
        }
    }
}

From source file:com.rks.musicx.services.MusicXService.java

@Override
public void updateService(String updateservices) {
    Intent intent = new Intent(updateservices);
    if (updateservices.equals(PLAYSTATE_CHANGED) && intent.getAction().equals(PLAYSTATE_CHANGED)) {
        sendBroadcast(intent);/*from w  w  w.  j av a 2  s .c o  m*/
    } else if (updateservices.equals(META_CHANGED) && intent.getAction().equals(META_CHANGED)) {
        Bundle bundle = new Bundle();
        bundle.putString(SONG_TITLE, getsongTitle());
        bundle.putString(SONG_ALBUM, getsongAlbumName());
        bundle.putLong(SONG_ALBUM_ID, getsongAlbumID());
        bundle.putString(SONG_ARTIST, getsongArtistName());
        bundle.putLong(SONG_ID, getsongId());
        bundle.putString(SONG_PATH, getsongData());
        bundle.putInt(SONG_TRACK_NUMBER, getsongNumber());
        bundle.putInt(POSITION_CHANGED, returnpos());
        intent.putExtras(bundle);
        Log.d(TAG, "broadcast song metadata");
        sendBroadcast(intent);
    } else if ((updateservices.equals(QUEUE_CHANGED) || updateservices.equals(ORDER_CHANGED)
            || updateservices.equals(ITEM_ADDED))
            && (intent.getAction().equals(QUEUE_CHANGED) || intent.getAction().equals(ORDER_CHANGED)
                    || intent.getAction().equals(ITEM_ADDED))) {
        sendBroadcast(intent);
        saveState(true);
    }
    if (onPlayNotify) {
        if (!Extras.getInstance().hideNotify()) {
            NotificationHandler.buildNotification(MusicXService.this, updateservices);
        }
    }
    musicxWidget.notifyChange(this, updateservices);
    musicXwidget4x4.notifyChange(this, updateservices);
    musicXWidget5x5.notifyChange(this, updateservices);
    if (!Extras.getInstance().hideLockscreen()) {
        MediaSession.lockscreenMedia(getMediaSession(), MusicXService.this, updateservices);
    }
}

From source file:com.android.deskclock.AlarmClockFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putLong(KEY_EXPANDED_ID, mAdapter.getExpandedId());
    outState.putLongArray(KEY_REPEAT_CHECKED_IDS, mAdapter.getRepeatArray());
    outState.putLongArray(KEY_SELECTED_ALARMS, mAdapter.getSelectedAlarmsArray());
    outState.putBundle(KEY_RINGTONE_TITLE_CACHE, mRingtoneTitleCache);
    outState.putParcelable(KEY_DELETED_ALARM, mDeletedAlarm);
    outState.putBoolean(KEY_UNDO_SHOWING, mUndoShowing);
    outState.putBundle(KEY_PREVIOUS_DAY_MAP, mAdapter.getPreviousDaysOfWeekMap());
    outState.putParcelable(KEY_SELECTED_ALARM, mSelectedAlarm);
}