List of usage examples for android.os Bundle getSerializable
@Override
@Nullable
public Serializable getSerializable(@Nullable String key)
From source file:com.firebase.ui.auth.ui.phone.PhoneVerificationActivity.java
@Override protected void onCreate(final Bundle savedInstance) { super.onCreate(savedInstance); setContentView(R.layout.activity_register_phone); mSaveSmartLock = mActivityHelper.getSaveSmartLockInstance(); mHandler = new Handler(); mVerificationState = VerificationState.VERIFICATION_NOT_STARTED; if (savedInstance != null && !savedInstance.isEmpty()) { mPhoneNumber = savedInstance.getString(KEY_VERIFICATION_PHONE); if (savedInstance.getSerializable(KEY_STATE) != null) { mVerificationState = (VerificationState) savedInstance.getSerializable(KEY_STATE); }// w ww .j a va 2 s .com return; } String phone = getIntent().getExtras().getString(ExtraConstants.EXTRA_PHONE); VerifyPhoneNumberFragment fragment = VerifyPhoneNumberFragment.newInstance(mActivityHelper.getFlowParams(), phone); getSupportFragmentManager().beginTransaction() .replace(R.id.fragment_verify_phone, fragment, VerifyPhoneNumberFragment.TAG) .disallowAddToBackStack().commit(); }
From source file:com.kopysoft.chronos.activities.ClockActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.header);/*from w ww . j a v a2 s . co m*/ Chronos chronos = new Chronos(this); Job curJob = chronos.getAllJobs().get(0); jobId = curJob; localPunchTable = chronos.getAllPunchesForThisPayPeriodByJob(curJob); chronos.close(); if (savedInstanceState != null) { payHolder = (PayPeriodHolder) savedInstanceState.getSerializable("payPeriod"); } else { payHolder = new PayPeriodHolder(curJob); } //getSupportActionBar().setListNavigationCallbacks(list, this) //This is a workaround for http://b.android.com/15340 from http://stackoverflow.com/a/5852198/132047 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { BitmapDrawable bg = (BitmapDrawable) getResources().getDrawable(R.drawable.bg_striped); bg.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT); getSupportActionBar().setBackgroundDrawable(bg); BitmapDrawable bgSplit = (BitmapDrawable) getResources().getDrawable(R.drawable.bg_striped_split_img); bgSplit.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT); getSupportActionBar().setSplitBackgroundDrawable(bgSplit); } getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); ActionBar.Tab tab = getSupportActionBar().newTab(); tab.setText("Today"); tab.setTabListener(this); getSupportActionBar().addTab(tab); tab = getSupportActionBar().newTab(); tab.setText("Pay Period"); tab.setTabListener(this); getSupportActionBar().addTab(tab); if (savedInstanceState != null) { getSupportActionBar().setSelectedNavigationItem(savedInstanceState.getInt("position")); } Duration dur = PayPeriodAdapterList.getTime(localPunchTable.getPunchPair(DateTime.now()), true); Intent runIntent = new Intent().setClass(this, NotificationBroadcast.class); runIntent.putExtra("timeToday", dur.getMillis()); this.sendBroadcast(runIntent); /* Intent newIntent = new Intent().setClass(this, PreferenceWizardActivity.class); this.startActivity(newIntent); */ }
From source file:com.nachiket.titan.LibraryPagerAdapter.java
@Override public void restoreState(Parcelable state, ClassLoader loader) { Bundle in = (Bundle) state; mPendingAlbumLimiter = (Limiter) in.getSerializable("limiter_albums"); mPendingSongLimiter = (Limiter) in.getSerializable("limiter_songs"); mPendingFileLimiter = (Limiter) in.getSerializable("limiter_files"); mSavedPositions = in.getIntArray("pos"); }
From source file:com.t2.dataouthandlertest.MainActivity.java
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { /// This gets called after EditRecord saves a record case ACTIVITY_REFERENCE: if (data != null) { Bundle extras = data.getExtras(); DataOutPacket updatedPacket = (DataOutPacket) extras.getSerializable("EXISTINGITEM"); //Log.e(TAG, updatedPacket.toString()); // Now save the updated record to database // Also need to update Global.sDataOutHandler.mRemotePacketCache Log.e(TAG, "**** " + updatedPacket.mChangedDate); try { updatedPacket.updateChangedDate(); Global.sDataOutHandler.updateRecord(updatedPacket); } catch (DataOutHandlerException e) { Log.e(TAG, e.toString()); }/*from w w w . ja v a 2s.com*/ } break; } }
From source file:com.docd.purefm.ui.dialogs.FilePropertiesDialog.java
@Override public void onCreate(Bundle state) { super.onCreate(state); final Bundle args = this.getArguments(); if (args == null) { throw new RuntimeException( "Arguments were not supplied. Make sure you created this DialogFragment using newInstance method"); }//from w w w . ja va 2 s. co m this.file = (GenericFile) args.getSerializable(Extras.EXTRA_FILE); }
From source file:com.solera.defrag.ViewStack.java
/** * @param view the view to retrieve the parameters for. * @param <T> the type of the returned parameter. * @return the parameters, or null if none found. *///from w ww .j a va2 s . c o m @SuppressWarnings("unchecked") @Nullable public <T extends Serializable> T getParameter(@NonNull Object view) { final Bundle parameters = getParameters(view); if (parameters == null) { return null; } else { return (T) parameters.getSerializable(SINGLE_PARAMETER_KEY); } }
From source file:eu.trentorise.smartcampus.eb.fragments.experience.EditExpFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mHelper = new CaptureHelper(getSherlockActivity(), 10, this); if (savedInstanceState != null && savedInstanceState.containsKey(ARG_EXP)) { exp = (Experience) savedInstanceState.getSerializable(ARG_EXP); src = (Experience) savedInstanceState.getSerializable(ARG_SRC); } else if (getArguments() != null && getArguments().containsKey(ARG_EXP)) { src = (Experience) getArguments().getSerializable(ARG_EXP); src.copyTo(exp = new Experience()); } else {// w ww .java2 s. com exp = new Experience(); src = exp; } if (savedInstanceState == null && getArguments() != null && getArguments().containsKey(ARG_VALUE)) { appendContent((GrabbedContent) getArguments().getSerializable(ARG_VALUE)); } if (savedInstanceState != null && savedInstanceState.containsKey("editMode")) { editMode = savedInstanceState.getBoolean("editMode"); } if (exp.getContents() == null) exp.setContents(new ArrayList<Content>()); setHasOptionsMenu(true); }
From source file:com.mario22gmail.license.nfc_project.FragmentWebCredentialsOnCard.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_webcredentials_on_card, container, false); rootView.setTag(TAG);/* w ww. jav a2 s. com*/ mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view); // LinearLayoutManager is used here, this will layout the elements in a similar fashion // to the way ListView would layout elements. The RecyclerView.LayoutManager defines how // elements are laid out. mLayoutManager = new LinearLayoutManager(getActivity()); mCurrentLayoutManagerType = LayoutManagerType.LINEAR_LAYOUT_MANAGER; if (savedInstanceState != null) { // Restore saved layout manager type. mCurrentLayoutManagerType = (LayoutManagerType) savedInstanceState.getSerializable(KEY_LAYOUT_MANAGER); } setRecyclerViewLayoutManager(mCurrentLayoutManagerType); mAdapter = new CredentialsAdapter(mDataset); // Set CustomAdapter as the adapter for RecyclerView. mRecyclerView.setAdapter(mAdapter); Intent myIntent = new Intent("fragment.setTab"); myIntent.putExtra("Title", "Continut card"); NavigationDrawerActivity.getAppContext().sendBroadcast(myIntent); return rootView; }
From source file:com.kunze.androidlocaltodo.TaskActivityFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log("onCreateView"); mProgrammaticChange = true;//from w w w.java 2 s . c o m TaskDatabase db = new TaskDatabase(getActivity()); View rootView = inflater.inflate(R.layout.activity_task, container, false); Bundle args = getArguments(); long id = args.getLong(TaskActivity.TASK_ID, 0); Task task = db.LoadTask(id); mOriginalTask = task; if (savedInstanceState != null) { mNewTask = (Task) savedInstanceState.getSerializable("mNewTask"); if (!mOriginalTask.equals(mNewTask)) { mProgrammaticChange = false; TaskChanged(rootView); mProgrammaticChange = true; } } else { mNewTask = new Task(task); } InitializeView(rootView); InitializeViewFields(rootView, task); return rootView; }
From source file:com.rsatyavolu.nanodegree.popularmovies.MainActivityFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.fragment_main, container, false); GridView gridView = (GridView) rootView.findViewById(R.id.gridview); gridView.setColumnWidth(200);/*from w w w . j a v a 2 s.co m*/ gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (parent.getItemAtPosition(position) != null) { ((Callback) getActivity()).onItemSelected(movieListAdapter.getItem(position)); } } }); if (savedInstanceState != null) { data = (List<MovieItemModel>) savedInstanceState.getSerializable(MOVIE_SEARCH_RESULTS); } else { data = new ArrayList<MovieItemModel>(); } movieListAdapter = new MovieIconViewAdapter(getActivity(), data); gridView.setAdapter(movieListAdapter); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); PreferenceManager.setDefaultValues(getActivity(), R.xml.pref_settings, false); String apiToken = prefs.getString(getString(R.string.pref_api_token_key), ""); String sortOption = prefs.getString(getString(R.string.pref_sort_key), ""); if (apiToken.length() <= 25) { Intent settings = new Intent(getActivity(), SettingsActivity.class); startActivity(settings); return rootView; } if (data.size() == 0) { DiscoverMoviesTask discoverMoviesTask = new DiscoverMoviesTask(); discoverMoviesTask.execute(DISCOVER_MOVIES_URL, apiToken, sortOption); } return rootView; }