Example usage for android.os Bundle putSerializable

List of usage examples for android.os Bundle putSerializable

Introduction

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

Prototype

@Override
public void putSerializable(@Nullable String key, @Nullable Serializable value) 

Source Link

Document

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

Usage

From source file:com.fjn.magazinereturncandidate.activities.SdmScannerActivity.java

/**
 * onRestart event handler//from   w  w  w  . j a v a2  s .  c  o  m
 */
@Override
protected void onRestart() {

    // Print log end process
    LogManagerCommon.i(TAG, Message.TAG_SCANNER_ACTIVITY + Message.MESSAGE_ACTIVITY_END);
    // Print log move screen
    LogManagerCommon.i(TAG, String.format(Message.MESSAGE_ACTIVITY_MOVE, Message.SCANNER_ACTIVITY_NAME,
            Message.UNLOCK_ACTIVITY_NAME));
    super.onRestart();
    if (timeout < (System.currentTimeMillis() - Constants.TIME_OUT)) {
        Intent intent = new Intent(this, UnlockScreenActivity.class);
        HashMap<String, LinkedList<String[]>> hashMapArrBook = new HashMap<>();
        hashMapArrBook.put(Constants.COLUMN_INFOR_LIST_SCAN, arrBookInlist);

        Bundle bundle = new Bundle();
        //put flag switch OCR
        bundle.putString(Constants.FLAG_SWITCH_OCR, flagSwitchOCR);
        bundle.putString(Constants.COLUMN_USER_ID, userID);
        bundle.putString(Constants.COLUMN_SHOP_ID, shopID);
        bundle.putString(Constants.COLUMN_SERVER_NAME, serverName);
        bundle.putString(Constants.COLUMN_LICENSE, license);
        bundle.putSerializable(Constants.COLUMN_INFOR_LIST_SCAN, hashMapArrBook);
        intent.putExtras(bundle);
        startActivity(intent);
        finish();
    }

    //         Activate HSM license
    ActivationResult activationResult = ActivationManager.activate(this, license);
    Toast.makeText(this, "Activation result: " + activationResult, Toast.LENGTH_LONG).show();

    // HSM init
    hsmDecoder = HSMDecoder.getInstance(this);

    // Declare symbology
    if (aSwitchOCR.isChecked()) {
        registerLicenseCommon.EnableOCRDisableJanCode(hsmDecoder);
    } else {
        registerLicenseCommon.EnableJanCodeDisableOCR(hsmDecoder);
    }

    //Check enable scan
    if (!isEnableScan) {
        registerLicenseCommon.DisableScan(hsmDecoder);
    }

    // Declare HSM component UI
    hsmDecoder.enableFlashOnDecode(false);
    hsmDecoder.enableSound(false);
    hsmDecoder.enableAimer(false);
    hsmDecoder.setWindowMode(WindowMode.CENTERING);
    hsmDecoder.setWindow(18, 42, 0, 100);

    // Assign listener
    hsmDecoder.registerPlugin(customPlugin);
}

From source file:github.popeen.dsub.fragments.SelectDirectoryFragment.java

@Override
public void onItemClicked(UpdateView<Entry> updateView, Entry entry) {
    if (entry.isDirectory()) {
        SubsonicFragment fragment = new SelectDirectoryFragment();
        Bundle args = new Bundle();
        args.putString(Constants.INTENT_EXTRA_NAME_ID, entry.getId());
        args.putString(Constants.INTENT_EXTRA_NAME_NAME, entry.getTitle());
        args.putSerializable(Constants.INTENT_EXTRA_NAME_DIRECTORY, entry);
        if ("newest".equals(albumListType)) {
            args.putBoolean(Constants.INTENT_EXTRA_REFRESH_LISTINGS, true);
        }/*from ww  w .  j  a v a  2  s.  c  om*/
        if (!entry.isAlbum()) {
            args.putBoolean(Constants.INTENT_EXTRA_NAME_ARTIST, true);
        }
        fragment.setArguments(args);

        replaceFragment(fragment, true);
    } else if (entry.isVideo()) {
        playVideo(entry);
    } else if (entry instanceof PodcastEpisode) {
        String status = ((PodcastEpisode) entry).getStatus();
        if ("error".equals(status)) {
            Util.toast(context, R.string.select_podcasts_error);
            return;
        } else if (!"completed".equals(status)) {
            Util.toast(context, R.string.select_podcasts_skipped);
            return;
        }

        onSongPress(Arrays.asList(entry), entry, false);
    } else {
        onSongPress(entries, entry, albumListType == null || "starred".equals(albumListType));
    }
}

From source file:co.taqat.call.ChatFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    if (message != null) {
        outState.putString("messageDraft", message.getText().toString());
    }/*  www .jav a2 s .com*/
    if (contact != null) {
        outState.putSerializable("contactDraft", contact);
        outState.putString("sipUriDraft", sipUri);
    }
    super.onSaveInstanceState(outState);
}

From source file:com.mojtaba.materialdatetimepicker.date.DatePickerDialog.java

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putInt(KEY_SELECTED_YEAR, mPersianCalendar.getPersianYear());
    outState.putInt(KEY_SELECTED_MONTH, mPersianCalendar.getPersianMonth());
    outState.putInt(KEY_SELECTED_DAY, mPersianCalendar.getPersianDay());
    outState.putInt(KEY_WEEK_START, mWeekStart);
    outState.putInt(KEY_YEAR_START, mMinYear);
    outState.putInt(KEY_YEAR_END, mMaxYear);
    outState.putInt(KEY_CURRENT_VIEW, mCurrentView);
    int listPosition = -1;
    if (mCurrentView == MONTH_AND_DAY_VIEW) {
        listPosition = mDayPickerView.getMostVisiblePosition();
    } else if (mCurrentView == YEAR_VIEW) {
        listPosition = mYearPickerView.getFirstVisiblePosition();
        outState.putInt(KEY_LIST_POSITION_OFFSET, mYearPickerView.getFirstPositionOffset());
    }//from   w  w  w  .j  a v a2  s.c om
    outState.putInt(KEY_LIST_POSITION, listPosition);
    outState.putSerializable(KEY_MIN_DATE, mMinDate);
    outState.putSerializable(KEY_MAX_DATE, mMaxDate);
    outState.putSerializable(KEY_HIGHLIGHTED_DAYS, highlightedDays);
    outState.putSerializable(KEY_SELECTABLE_DAYS, selectableDays);
    outState.putBoolean(KEY_THEME_DARK, mThemeDark);
    outState.putBoolean(KEY_THEME_DARK_CHANGED, mThemeDarkChanged);
    outState.putInt(KEY_ACCENT, mAccentColor);
    outState.putBoolean(KEY_VIBRATE, mVibrate);
    outState.putBoolean(KEY_DISMISS, mDismissOnPause);
    outState.putBoolean(KEY_AUTO_DISMISS, mAutoDismiss);
    outState.putInt(KEY_DEFAULT_VIEW, mDefaultView);
    outState.putString(KEY_TITLE, mTitle);
    outState.putInt(KEY_OK_RESID, mOkResid);
    outState.putString(KEY_OK_STRING, mOkString);
    outState.putInt(KEY_CANCEL_RESID, mCancelResid);
    outState.putString(KEY_CANCEL_STRING, mCancelString);
}

From source file:com.kncwallet.wallet.ui.SendCoinsFragment.java

private void saveInstanceState(final Bundle outState) {
    outState.putSerializable("state", state);

    if (validatedAddress != null)
        outState.putParcelable("validated_address", validatedAddress);

    outState.putBoolean("is_valid_amounts", isValidAmounts);

    if (sentTransaction != null)
        outState.putSerializable("sent_transaction_hash", sentTransaction.getHash());

    outState.putString("bluetooth_mac", bluetoothMac);

    if (bluetoothAck != null)
        outState.putBoolean("bluetooth_ack", bluetoothAck);
}

From source file:co.taqat.call.LinphoneActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    outState.putSerializable("currentFragment", currentFragment);
    outState.putBoolean("fetchedContactsOnce", fetchedContactsOnce);
    super.onSaveInstanceState(outState);
}

From source file:co.taqat.call.LinphoneActivity.java

public void addContact(String displayName, String sipUri) {
    Bundle extras = new Bundle();
    extras.putSerializable("NewSipAdress", sipUri);
    changeCurrentFragment(FragmentsAvailable.CONTACT_EDITOR, extras);
}

From source file:co.taqat.call.LinphoneActivity.java

public void editContact(LinphoneContact contact) {
    Bundle extras = new Bundle();
    extras.putSerializable("Contact", contact);
    changeCurrentFragment(FragmentsAvailable.CONTACT_EDITOR, extras);
}

From source file:co.taqat.call.LinphoneActivity.java

public void editContact(LinphoneContact contact, String sipAddress) {
    Bundle extras = new Bundle();
    extras.putSerializable("Contact", contact);
    extras.putSerializable("NewSipAdress", sipAddress);
    changeCurrentFragment(FragmentsAvailable.CONTACT_EDITOR, extras);
}

From source file:com.codetroopers.betterpickers.radialtimepicker.RadialTimePickerDialogFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    if (mTimePicker != null) {
        outState.putInt(KEY_HOUR_OF_DAY, mTimePicker.getHours());
        outState.putInt(KEY_MINUTE, mTimePicker.getMinutes());
        outState.putBoolean(KEY_IS_24_HOUR_VIEW, mIs24HourMode);
        outState.putInt(KEY_CURRENT_ITEM_SHOWING, mTimePicker.getCurrentItemShowing());
        outState.putBoolean(KEY_IN_KB_MODE, mInKbMode);
        if (mFutureMinutesLimit != null)
            outState.putInt(KEY_FUTURE_MINUTES_LIMIT, mFutureMinutesLimit);
        if (mPastMinutesLimit != null)
            outState.putInt(KEY_PAST_MINUTES_LIMIT, mPastMinutesLimit);
        outState.putSerializable(KEY_CURRENT_DATE, mValidateDateTime);
        outState.putSerializable(KEY_PICKER_DATE, mPickerDate);
        if (mInKbMode)
            outState.putIntegerArrayList(KEY_TYPED_TIMES, mTypedTimes);
        outState.putInt(KEY_STYLE, mStyleResId);
    }/*w  w  w  .j  av a2s  . c  om*/
}