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:edu.mecc.race2ged.fragments.ClassCardListFragment.java

/**
 * {@inheritDoc}// ww w. ja  v  a 2 s .c o  m
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        County tmp = (County) savedInstanceState.getSerializable(ARG_COUNTY);
        if (tmp != null)
            mCounty = tmp;
    }
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_card_list, container, false);
    mListView = (ListView) view.findViewById(R.id.list);

    //Setup list animations
    animationAdapter.setAbsListView(mListView);

    mListView.setAdapter(animationAdapter);

    return view;
}

From source file:com.connectsdk.smarthomesampler.fragment.SetupMultiChoiceFragment.java

@SuppressWarnings("unchecked")
@Override//from w  w  w .j  a v  a2 s .com
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();
    if (args != null) {
        this.ids = (ArrayList<String>) args.getSerializable("ids");
    }
}

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

@Override
protected void resumeFromIntentExtras(@Nonnull Bundle bundle) {
    final EventTable.Row event = Utils
            .checkNotNull((EventTable.Row) bundle.getSerializable(HealthDatabase.EVENT_TABLE.getName()));
    if (!event.getTypeId().equals(EventTypeTable.NOTE.getId())) {
        throw new EventTypeTable.BadEventTypeException(EventTypeTable.NOTE, event.getTypeId().getId());
    }/*from   www  .j a v  a 2  s  .  com*/

    getEventFragment().setRow(event);

    getExecutor().perform(new TransactionExecutor.Operation() {
        @Override
        public void doTransactionally(@Nonnull Database database, @Nonnull Transaction transaction) {
            NoteEventTable.Row noteEvent = HealthDatabase.NOTE_EVENT_TABLE.select1(database,
                    foreignKey(NoteEventTable.EVENT_ID, event.getConcretePrimaryKey().getId()));

            final NoteTable.Row note = HealthDatabase.NOTE_TABLE.select1(database,
                    noteEvent.getConcretePrimaryKey().getNoteId());

            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    getNoteFragment().setRow(note);
                }
            });
        }
    });
}

From source file:com.agna.setmaster.ui.base.dialog.BaseBottomSheetDialog.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    RemoteLogger.logViewCreated(this);
    if (savedInstanceState != null) {
        parentType = (Parent) savedInstanceState.getSerializable(STATE_PARENT_TYPE);
    }/*from   w  w w  .j  a  v a2  s .co  m*/
}

From source file:com.nbossard.packlist.gui.ItemDetailFragment.java

@Override
public final void onCreate(@Nullable final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Bundle args = getArguments();
    if (args != null) {
        mItem = (Item) args.getSerializable(BUNDLE_PAR_ITEM);
    }//w  w  w  .  j  ava2s .  c  o  m
}

From source file:net.reichholf.dreamdroid.loader.AsyncByteLoader.java

@SuppressWarnings("unchecked")
private void init(Context context, Bundle args) {
    DreamDroid.loadCurrentProfile(context);
    mShc = new SimpleHttpClient();
    if (args != null && args.containsKey("params"))
        mParams = (ArrayList<NameValuePair>) args.getSerializable("params");
    else//from   w w  w.j av a  2s.  co m
        mParams = null;

    mUri = args.getString("uri");
}

From source file:net.reichholf.dreamdroid.activities.SearchEpgActivity.java

@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);

    mCurrentItem = (ExtendedHashMap) savedInstanceState.getSerializable("currentItem");
    setAdapter();/*  w  w w .j a v a  2 s .c  om*/
}

From source file:com.makotogo.mobile.datetimepickerexample.MainActivity.java

@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
    mLocalDateTime = (LocalDateTime) savedInstanceState.getSerializable(STATE_LOCAL_DATE_TIME);
}

From source file:com.jaspersoft.android.jaspermobile.dialog.SortDialogFragment.java

protected void initDialogParams() {
    super.initDialogParams();

    Bundle args = getArguments();
    if (args != null) {
        if (args.containsKey(SORT_ORDER_ARG)) {
            mSortOrder = (SortOrder) args.getSerializable(SORT_ORDER_ARG);
        }/*from   w  ww. j  ava 2  s . com*/
    }
}

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

@Override
protected void resumeFromIntentExtras(@Nonnull Bundle bundle) {
    final EventTable.Row event = Utils
            .checkNotNull((EventTable.Row) bundle.getSerializable(HealthDatabase.EVENT_TABLE.getName()));
    if (!event.getTypeId().equals(EventTypeTable.MEDICATION.getId())) {
        throw new EventTypeTable.BadEventTypeException(EventTypeTable.MEDICATION, event.getTypeId().getId());
    }//from w w w.  j  a  va 2  s .  c  o  m

    getEventFragment().setRow(event);

    getExecutor().perform(new TransactionExecutor.Operation() {
        @Override
        public void doTransactionally(@Nonnull Database database, @Nonnull Transaction transaction) {
            mMedEvent = HealthDatabase.MEDICATION_EVENT_TABLE.select1(database,
                    foreignKey(MedicationEventTable.EVENT_ID, event.getConcretePrimaryKey().getId()));

            final MedicationTable.Row med = HealthDatabase.MEDICATION_TABLE.select1(database, foreignKey(
                    MedicationTable._ID, mMedEvent.getConcretePrimaryKey().getMedicationId().getId()));

            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    getMedicationFragment().setRow(med);
                }
            });
        }
    });
}