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.whamads.nativecamera.NativeCameraLauncher.java

@Override
public Bundle onSaveInstanceState() {

    Bundle state = new Bundle();
    state.putInt("mQuality", mQuality);
    state.putInt("targetWidth", targetWidth);
    state.putInt("targetHeight", targetHeight);
    state.putString("date", date);
    state.putParcelable("imageUri", imageUri);
    state.putSerializable("photo", photo);

    return state;
}

From source file:com.deliciousdroid.activity.BrowseBookmarks.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    if (lastSelected != null && lastViewType != null) {
        savedInstanceState.putSerializable(STATE_LASTBOOKMARK, lastSelected);
        savedInstanceState.putSerializable(STATE_LASTVIEWTYPE, lastViewType);
    }// w  w w.  j a  v  a  2s.c om

    savedInstanceState.putString(STATE_USERNAME, username);
    savedInstanceState.putString(STATE_TAGNAME, tagname);
    savedInstanceState.putBoolean(STATE_UNREAD, unread);
    savedInstanceState.putString(STATE_QUERY, query);

    super.onSaveInstanceState(savedInstanceState);
}

From source file:com.amazon.adobepass.auth.AdobepassAuthentication.java

/**
 * Bundle to be sent on authorization failure
 *
 * @param statusCode status code of failure
 * @param bundle     Bundle to populate//from ww w.jav  a2  s. com
 * @param throwable  throwable thrown
 */
private void populateAuthorizationFailureBundle(int statusCode, Bundle bundle, Throwable throwable) {

    bundle.putInt(ResponseHandler.STATUS_CODE, statusCode);
    bundle.putString(AuthenticationConstants.ERROR_CATEGORY,
            AuthenticationConstants.AUTHORIZATION_ERROR_CATEGORY);
    bundle.putSerializable(AuthenticationConstants.ERROR_CAUSE, throwable);
}

From source file:com.amazon.adobepass.auth.AdobepassAuthentication.java

/**
 * Bundle to be sent on authentication failure
 *
 * @param statusCode status code of failure
 * @param bundle     Bundle to populate//w w  w.  j ava2 s . c  o m
 * @param throwable  throwable thrown
 */
private void populateAuthenticationFailureBundle(int statusCode, Bundle bundle, Throwable throwable) {

    bundle.putInt(ResponseHandler.STATUS_CODE, statusCode);
    bundle.putString(AuthenticationConstants.ERROR_CATEGORY,
            AuthenticationConstants.AUTHENTICATION_ERROR_CATEGORY);
    bundle.putSerializable(AuthenticationConstants.ERROR_CAUSE, throwable);
}

From source file:com.github.barcodeeye.scan.CaptureActivity.java

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.activity_capture);

    context2 = this;
    StringBuilder loginData = new StringBuilder();
    try {//from ww  w.  j  a va2s .  c o  m

        File f = new File(getCacheDir(), "LoginData.txt");
        if (f.exists()) {
            BufferedReader br = new BufferedReader(new FileReader(f));
            String line;

            while ((line = br.readLine()) != null) {
                loginData.append(line);
            }

            if (!loginData.toString().isEmpty()) {
                System.out.println("!!!!!!" + loginData.toString() + "!!!!!!!");
                // Intent Creation and Initialization
                Intent intent = new Intent(context2, InformationPreviewActivity.class);
                //I have added the line: (flags) (for closing the first activity)
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                // Create a Bundle and Put Bundle into it (SENDS PERSON)
                Bundle bundleObject = new Bundle();
                bundleObject.putSerializable("key", loginData.toString());
                // Put Bundle into Intent and call start Activity
                intent.putExtras(bundleObject);
                startActivity(intent);
                //I have added the line: (finish) (for closing the first activity)
                finish();
            }
        }
    } catch (IOException e) {
        //You'll need to add proper error handling here
    }

    mImageManager = new ImageManager(this);

    mHasSurface = false;
    mInactivityTimer = new InactivityTimer(this);
    mBeepManager = new BeepManager(this);
    mAmbientLightManager = new AmbientLightManager(this);

    mViewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);

    if (loginData.toString().isEmpty()) {
        Toast.makeText(getApplicationContext(), "Scan QR code for Login", Toast.LENGTH_LONG).show();
    }

    PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
}

From source file:android.support.car.ui.CarNavExtender.java

@Override
public NotificationCompat.Builder extend(NotificationCompat.Builder builder) {
    Bundle b = new Bundle();
    b.putBoolean(EXTRA_IS_EXTENDED, true);
    b.putSerializable(EXTRA_CONTENT_ID, mContentId);
    b.putInt(EXTRA_TYPE, mType);/* w  w  w  .  j av a2  s .  c  o  m*/
    b.putCharSequence(Notification.EXTRA_TITLE, mContentTitle);
    b.putCharSequence(Notification.EXTRA_TEXT, mContentText);
    b.putCharSequence(EXTRA_SUB_TEXT, mSubText);
    b.putParcelable(Notification.EXTRA_LARGE_ICON, mLargeIcon);
    b.putInt(EXTRA_ACTION_ICON, mActionIcon);
    b.putParcelable(EXTRA_CONTENT_INTENT, mContentIntent);
    b.putInt(EXTRA_COLOR, mColor);
    b.putInt(EXTRA_NIGHT_COLOR, mNightColor);
    b.putBoolean(EXTRA_STREAM_VISIBILITY, mShowInStream);
    b.putBoolean(EXTRA_HEADS_UP_VISIBILITY, mShowAsHeadsUp);
    b.putBoolean(EXTRA_IGNORE_IN_STREAM, mIgnoreInStream);
    builder.getExtras().putBundle(EXTRA_CAR_EXTENDER, b);
    return builder;
}

From source file:com.adamas.client.android.ui.ConnectorsFragment.java

private void editAdamasConnector(int position) {
    Connector ac = this._vpnList.get(position);
    Intent intent = new Intent(getActivity(), EditConnectorActivity.class);
    Bundle mBundle = new Bundle();
    mBundle.putSerializable(EditConnectorActivity.ADAMAS_CONNECTOR, ac);
    intent.putExtras(mBundle);//from   w w  w.ja  v a  2  s  . c  o m
    startActivityForResult(intent, MainActivity.MANUALLY_EDIT_CONNECTOR_REQUEST_CODE);
}

From source file:com.gh4a.activities.IssueLabelListActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    if (mActionMode != null) {
        if (mAddedLabel != null) {
            outState.putSerializable(STATE_KEY_ADDED_LABEL, mAddedLabel);
        } else {//from   w w  w. j a v a  2 s  .  c  o  m
            outState.putSerializable(STATE_KEY_EDITING_LABEL, mActionMode.mLabel);
        }
    }
}

From source file:com.aitorvs.android.fingerlock.FingerprintDialog.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putSerializable(TAG_STAGE, mStage);
}

From source file:gov.wa.wsdot.android.wsdot.ui.FerriesRouteSchedulesDaySailingsFragment.java

@Override
public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    String terminalNames = scheduleDateItems.get(0).getFerriesTerminalItem().get(position)
            .getDepartingTerminalName() + " to "
            + scheduleDateItems.get(0).getFerriesTerminalItem().get(position).getArrivingTerminalName();

    Bundle b = new Bundle();
    Intent intent = new Intent(getActivity(), FerriesRouteSchedulesDayDeparturesActivity.class);
    b.putString("terminalNames", terminalNames);
    b.putInt("position", position);
    b.putSerializable("scheduleDateItems", scheduleDateItems);
    intent.putExtras(b);//  www  .  j  a  v a2s .  c o m
    startActivity(intent);
}