List of usage examples for android.os Bundle getParcelableArrayList
@Nullable public <T extends Parcelable> ArrayList<T> getParcelableArrayList(@Nullable String key)
From source file:com.emuneee.nctrafficcams.ui.activities.DetailActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detail_activity); Bundle extra = getIntent().getExtras(); if (extra != null) { ArrayList<Parcelable> cameras = extra.getParcelableArrayList(Constants.BUNDLE_CAMERAS); mViewPager = (ViewPager) findViewById(R.id.pager); mViewPager.setOffscreenPageLimit(3); mAdapter = new DetailAdapter(getSupportFragmentManager(), cameras); mViewPager.setAdapter(mAdapter); mViewPager.setCurrentItem(extra.getInt(Constants.BUNDLE_CURRENT_INDEX)); }/*from w w w . j a v a 2s. com*/ // configure the action bar ActionBar actionBar = getSupportActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setDisplayHomeAsUpEnabled(true); int orientation = getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { actionBar.hide(); } }
From source file:dk.cafeanalog.OpeningsFragment.java
@Override public void setArguments(Bundle args) { super.setArguments(args); mOpenings = args.getParcelableArrayList(OPENING_CONTENT); }
From source file:com.jaspersoft.android.jaspermobile.dialog.OutputFormatDialogFragment.java
@Override protected void initDialogParams() { super.initDialogParams(); Bundle args = getArguments(); if (args != null) { selectedFormats = args.getParcelableArrayList(SELECTED_FORMATS_ARG); formats = args.getParcelableArrayList(FORMATS_ARG); }/* ww w . j a va 2 s. c o m*/ }
From source file:org.amahi.anywhere.fragment.ServerAppsFragment.java
private void setUpAppsState(Bundle state) { List<ServerApp> apps = state.getParcelableArrayList(State.APPS); if (apps != null) { mEmptyLinearLayout.setVisibility(View.GONE); setUpAppsContent(apps);/*from w w w .j av a 2 s. c o m*/ showAppsContent(); } else { mEmptyLinearLayout.setVisibility(View.VISIBLE); } }
From source file:com.diedrico.diedricoapp.DiedricoFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { final View view = inflater.inflate(R.layout.fragment_diedrico, parent, false); diedrico = (ImageView) view.findViewById(R.id.projection); createDiedrico = new CreateDiedrico(diedrico); //If there is a coming intent (from MenuPicActivity) we have to catch it and put the content Bundle extras = getActivity().getIntent().getExtras(); if (extras != null) { List<PointVector> comingPointVectors = extras.getParcelableArrayList("pointVectors"); List<LineVector> comingLineVectors = extras.getParcelableArrayList("lineVectors"); List<PlaneVector> comingPlaneVectors = extras.getParcelableArrayList("planeVectors"); setDiedrico(comingPointVectors, comingLineVectors, comingPlaneVectors); //To create the diedrico (projection) }//from w w w . ja va 2 s.c o m return view; }
From source file:me.xiaopan.sketchsample.fragment.ImageDetailFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); handler = new Handler(); startPlay = new StartPlay(); Bundle arguments = getArguments(); if (arguments != null) { imageList = arguments.getParcelableArrayList(PARAM_REQUIRED_STRING_ARRAY_LIST_URLS); loadingImageOptionsKey = arguments.getString(PARAM_REQUIRED_STRING_LOADING_IMAGE_OPTIONS_KEY); position = arguments.getInt(PARAM_OPTIONAL_INT_DEFAULT_POSITION); }//from www . ja v a 2s. c om }
From source file:org.strongswan.android.ui.fragment.RemediationInstructionsFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (savedInstanceState != null) { mInstructions = savedInstanceState.getParcelableArrayList(EXTRA_REMEDIATION_INSTRUCTIONS); mCurrentPosition = savedInstanceState.getInt(KEY_POSITION); }/*w ww .j a va 2 s .co m*/ }
From source file:org.amahi.anywhere.fragment.ServerSharesFragment.java
private void setUpSharesState(Bundle state) { List<ServerShare> shares = state.getParcelableArrayList(State.SHARES); if (shares != null) { setUpSharesContent(shares);//ww w .j av a 2s . c om showSharesContent(); mEmptyLinearLayout.setVisibility(View.GONE); } else { mEmptyLinearLayout.setVisibility(View.VISIBLE); } }
From source file:com.krayzk9s.imgurholo.ui.ImagePager.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null) { imageData = savedInstanceState.getParcelableArrayList("imageData"); start = savedInstanceState.getInt("start"); } else {//w w w. j av a2s . c o m Bundle bundle = getArguments(); start = bundle.getInt("start"); imageData = bundle.getParcelableArrayList("ids"); } }
From source file:com.github.johnpersano.supertoasts.library.SuperActivityToast.java
/** * This should be called in the {@link android.app.Activity#onCreate(android.os.Bundle)} * method of your Activity. If you used an * {@link com.github.johnpersano.supertoasts.library.SuperToast.OnDismissListener} * or/*from ww w . j av a 2 s .co m*/ * {@link com.github.johnpersano.supertoasts.library.SuperActivityToast.OnButtonClickListener} * in your SuperActivityToast, use * {@link com.github.johnpersano.supertoasts.library.utils.ListenerUtils#newInstance()} * along with * {@link com.github.johnpersano.supertoasts.library.utils.ListenerUtils * #putListener(String, OnButtonClickListener)} and * {@link com.github.johnpersano.supertoasts.library.utils.ListenerUtils * #putListener(String, OnDismissListener)} to reattach them * after orientation change recovery. * * @param context The Activity Context * @param bundle The Bundle provided in onCreate() * @param listenerUtils A ListenerUtils object with every listener used added to it */ public static void onRestoreState(Context context, Bundle bundle, ListenerUtils listenerUtils) { if (bundle == null) return; // The Bundle will be null sometimes // Get the List created in onSaveState() final ArrayList<Style> styleList = bundle.getParcelableArrayList(BUNDLE_KEY); if (styleList == null) { Log.e(SuperActivityToast.class.getName(), "Cannot recreate SuperActivityToasts onRestoreState(). Was " + "onSaveState() called?"); return; } // Create a flag that knows if the SuperActivityToast is first in the List or not boolean firstInList = true; for (Style style : styleList) { if (!style.isSuperActivityToast) new SuperToast(context, style).show(); else { final SuperActivityToast superActivityToast = new SuperActivityToast(context, style); // This SuperActivityToast was most likely showing before the orientation change so ignore the show animation if (firstInList) superActivityToast.fromOrientationChange(); final OnDismissListener onDismissListener = listenerUtils.getOnDismissListenerHashMap() .get(style.dismissTag); final OnButtonClickListener onButtonClickListener = listenerUtils.getOnButtonClickListenerHashMap() .get(style.buttonTag); // The SuperActivityToast had an OnDismissListener, reattach it if (onDismissListener != null) { superActivityToast.setOnDismissListener(style.dismissTag, style.dismissToken, onDismissListener); } // The SuperActivityToast had an OnButtonClickListener, reattach it if (onButtonClickListener != null) { superActivityToast.setOnButtonClickListener(style.buttonTag, style.buttonToken, onButtonClickListener); } superActivityToast.show(); } firstInList = false; } }