Example usage for android.os Bundle getSerializable

List of usage examples for android.os Bundle getSerializable

Introduction

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

Prototype

@Override
@Nullable
public Serializable getSerializable(@Nullable String key) 

Source Link

Document

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Usage

From source file:com.devergence.example.fraglistview.fragments.FragmentFeatured.java

/**
 * Restaura el estado de las variables globales
 * @param state/*  ww w . j a  v  a2s .  c  o  m*/
 */
void restoreInstanceState(Bundle state) {
    if (state != null)
        mFeaturedObject = (FeaturedItem) state.getSerializable(STATEKEY_ITEM);
}

From source file:de.grobox.liberario.departures.DeparturesLoader.java

public DeparturesLoader(Context context, TransportNetwork network, Bundle args) {
    super(context);

    this.network = network;
    this.stationId = args.getString(STATION_ID);
    this.date = (Date) args.getSerializable(DATE);
    this.maxDepartures = args.getInt(MAX_DEPARTURES);
}

From source file:augsburg.se.alltagsguide.event.EventActivity.java

@Override
public Loader<EventPage> onCreateLoader(int id, Bundle args) {
    AvailableLanguage language = (AvailableLanguage) args.getSerializable(ARG_LANGUAGE);
    if (language == null || language.getLoadedLanguage() == null) {
        Ln.d("AvailableLanguage is null or has no language.");
        return null;
    }/*from w ww .  j  a  va 2 s.  c  o  m*/
    return new EventPageLoader(this, mPrefUtilities.getLocation(), language.getLoadedLanguage(),
            language.getOtherPageId());
}

From source file:de.uni.stuttgart.informatik.ToureNPlaner.UI.Activities.EditNodeScreen.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.nodepreferences);

    // If we get created for the first time we get our data from the intent
    Bundle data = savedInstanceState != null ? savedInstanceState : getIntent().getExtras();
    session = (Session) data.getSerializable(Session.IDENTIFIER);
    node = (Node) data.getSerializable("node");
    index = data.getInt("index");

    if (!session.getSelectedAlgorithm().getPointConstraintTypes().isEmpty()) {
        setupListView();//from   w w w  .  java  2 s.c  om
    }
    setupButtons();
}

From source file:augsburg.se.alltagsguide.settings.PrefFragment.java

@Override
public Loader<List<Page>> onCreateLoader(int id, Bundle args) {
    LoadingType loadingType = (LoadingType) args.getSerializable(LOADING_TYPE_KEY);
    return new DisclaimersLoader(getActivity(), mPrefUtilities.getLocation(), mPrefUtilities.getLanguage(),
            loadingType);/*  ww w  .  java2 s .  c o m*/
}

From source file:com.robwilliamson.healthyesther.edit.MedicationEventActivity.java

@Override
protected void resumeFromSavedState(@Nonnull Bundle bundle) {
    mMedEvent = (MedicationEventTable.Row) bundle.getSerializable(MEDICATION_EVENT);
}

From source file:de.uni.stuttgart.informatik.ToureNPlaner.UI.Fragments.ConstraintListFragment.java

@Override
@SuppressWarnings("unchecked")
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // If we get created for the first time we get our data from the intent
    Bundle data = savedInstanceState != null ? savedInstanceState : getArguments();
    constraints = (ArrayList<Constraint>) data.getSerializable(IDENTIFIER);
}

From source file:de.schildbach.wallet.ui.WalletAddressDialogFragment.java

@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    final Bundle args = getArguments();
    final Address address = (Address) args.getSerializable(KEY_ADDRESS);
    final String addressStr = address.toBase58();
    final String addressLabel = args.getString(KEY_ADDRESS_LABEL);

    final Dialog dialog = new Dialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.wallet_address_dialog);
    dialog.setCanceledOnTouchOutside(true);

    final String uri = BitcoinURI.convertToBitcoinURI(address, null, addressLabel, null);
    final BitmapDrawable bitmap = new BitmapDrawable(getResources(), Qr.bitmap(uri));
    bitmap.setFilterBitmap(false);/*  ww w .  j  a  v a 2 s  .c o  m*/
    final ImageView imageView = (ImageView) dialog.findViewById(R.id.wallet_address_dialog_image);
    imageView.setImageDrawable(bitmap);

    final View labelButtonView = dialog.findViewById(R.id.wallet_address_dialog_label_button);
    final TextView labelView = (TextView) dialog.findViewById(R.id.wallet_address_dialog_label);
    final CharSequence label = WalletUtils.formatHash(addressStr, Constants.ADDRESS_FORMAT_GROUP_SIZE,
            Constants.ADDRESS_FORMAT_LINE_SIZE);
    labelView.setText(label);
    labelButtonView.setVisibility(View.VISIBLE);
    labelButtonView.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(final View v) {
            final Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("text/plain");
            intent.putExtra(Intent.EXTRA_TEXT, addressStr);
            startActivity(Intent.createChooser(intent, getString(R.string.bitmap_fragment_share)));
            log.info("wallet address shared via intent: {}", addressStr);
        }
    });

    final View hintView = dialog.findViewById(R.id.wallet_address_dialog_hint);
    hintView.setVisibility(
            getResources().getBoolean(R.bool.show_wallet_address_dialog_hint) ? View.VISIBLE : View.GONE);

    final View dialogView = dialog.findViewById(R.id.wallet_address_dialog_group);
    dialogView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(final View v) {
            dismiss();
        }
    });

    return dialog;
}

From source file:com.robwilliamson.healthyesther.edit.MealEventActivity.java

@Override
protected void resumeFromSavedState(@Nonnull Bundle bundle) {
    mMealEvent = (MealEventTable.Row) bundle.getSerializable(MEAL_EVENT);
}

From source file:com.xclong.vehiclemonitordemo.fragment.ListDataFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    TAG = this.getClass().getSimpleName();
    Bundle bundle = getArguments();
    if (bundle != null) {
        vehicledInfo = (VehicledInfo) bundle.getSerializable(KEY);
    }// w w w .ja  va2s  . c  om
}