/** * The referer data associated with the app link. This will contain Facebook specific * information like fb_access_token, fb_expires_in, and fb_ref. * * @return the referer data. */ public Bundle getRefererData() { if (argumentBundle != null) { return argumentBundle.getBundle(ARGUMENTS_REFERER_DATA_KEY); } return null; }
RouterTransaction(@NonNull Bundle bundle) { controller = Controller.newInstance(bundle.getBundle(KEY_VIEW_CONTROLLER_BUNDLE)); pushControllerChangeHandler = ControllerChangeHandler.fromBundle(bundle.getBundle(KEY_PUSH_TRANSITION)); popControllerChangeHandler = ControllerChangeHandler.fromBundle(bundle.getBundle(KEY_POP_TRANSITION)); tag = bundle.getString(KEY_TAG); transactionIndex = bundle.getInt(KEY_INDEX); attachedToRouter = bundle.getBoolean(KEY_ATTACHED_TO_ROUTER); }
@Override @NonNull protected final View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) { return onCreateView(inflater, container, viewState == null ? null : viewState.getBundle(KEY_VIEW_STATE_BUNDLE)); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null) presenterDelegate.onRestoreInstanceState(savedInstanceState.getBundle(PRESENTER_STATE_KEY)); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null) presenterDelegate.onRestoreInstanceState(savedInstanceState.getBundle(PRESENTER_STATE_KEY)); }
@Override public void onCreate(Bundle bundle) { super.onCreate(bundle); if (bundle != null) presenterDelegate.onRestoreInstanceState(bundle.getBundle(PRESENTER_STATE_KEY)); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null) presenterDelegate.onRestoreInstanceState(savedInstanceState.getBundle(PRESENTER_STATE_KEY)); }
@Nullable public static ControllerChangeHandler fromBundle(@Nullable Bundle bundle) { if (bundle != null) { String className = bundle.getString(KEY_CLASS_NAME); ControllerChangeHandler changeHandler = ClassUtils.newInstance(className); //noinspection ConstantConditions changeHandler.restoreFromBundle(bundle.getBundle(KEY_SAVED_STATE)); return changeHandler; } else { return null; } }
public static Bundle getErrorDataFromResultIntent(Intent resultIntent) { if (!isErrorResult(resultIntent)) { return null; } Bundle bridgeArgs = getBridgeArgumentsFromIntent(resultIntent); if (bridgeArgs != null) { return bridgeArgs.getBundle(BRIDGE_ARG_ERROR_BUNDLE); } return resultIntent.getExtras(); }
public static Bundle getSuccessResultsFromIntent(Intent resultIntent) { int version = getProtocolVersionFromIntent(resultIntent); Bundle extras = resultIntent.getExtras(); if (!isVersionCompatibleWithBucketedIntent(version) || extras == null) { return extras; } return extras.getBundle(EXTRA_PROTOCOL_METHOD_RESULTS); }
@Override protected void onRestoreInstanceState(Parcelable state) { Bundle bundle = (Bundle) state; super.onRestoreInstanceState(bundle.getParcelable(PARENT_STATE_KEY)); presenterDelegate.onRestoreInstanceState(bundle.getBundle(PRESENTER_STATE_KEY)); }
@Override protected void onRestoreInstanceState(Bundle state) { super.onRestoreInstanceState(state); adapter.onRestoreInstanceState(state.getBundle(STATE_ADAPTER)); } }
@Override protected void onRestoreInstanceState(Bundle state) { super.onRestoreInstanceState(state); adapter.onRestoreInstanceState(state.getBundle(STATE_ADAPTER)); } }
@Override protected void onRestoreInstanceState(Bundle state) { super.onRestoreInstanceState(state); adapter.onRestoreInstanceState(state.getBundle(STATE_ADAPTER)); } }
@Override public void restoreFromBundle(@NonNull Bundle bundle) { super.restoreFromBundle(bundle); String className = bundle.getString(KEY_CHANGE_HANDLER_CLASS); changeHandler = ClassUtils.newInstance(className); //noinspection ConstantConditions changeHandler.restoreFromBundle(bundle.getBundle(KEY_HANDLER_STATE)); }
@Override public void onCreate(Bundle bundle) { super.onCreate(bundle); if (bundle != null) presenterDelegate.onRestoreInstanceState(bundle.getBundle(PRESENTER_STATE_KEY)); }
private void restoreViewState(@NonNull View view) { if (viewState != null) { view.restoreHierarchyState(viewState.getSparseParcelableArray(KEY_VIEW_STATE_HIERARCHY)); Bundle savedViewState = viewState.getBundle(KEY_VIEW_STATE_BUNDLE); savedViewState.setClassLoader(getClass().getClassLoader()); onRestoreViewState(view, savedViewState); restoreChildControllerHosts(); List<LifecycleListener> listeners = new ArrayList<>(lifecycleListeners); for (LifecycleListener lifecycleListener : listeners) { lifecycleListener.onRestoreViewState(this, viewState); } } }
@Override protected void onRestoreInstanceState(Bundle state) { super.onRestoreInstanceState(state); adapter.onRestoreInstanceState(state.getBundle(STATE_ADAPTER)); tabs.removeAllTabs(); for (int i=0;i<adapter.getItemCount();i++) { tabs.addTab(tabs.newTab().setText(adapter.getTabText(i))); } }
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (savedInstanceState != null) { getAdapter().restoreState(savedInstanceState.getBundle(STATE_ADAPTER)); } getAdapter().setCardViewEnabled(Preferences.isListItemCardView(getActivity())); getAdapter().setCustomTabsDelegate(mCustomTabsDelegate); mRecyclerView.setAdapter(getAdapter()); mScrollableHelper = new KeyDelegate.RecyclerViewHelper(mRecyclerView, KeyDelegate.RecyclerViewHelper.SCROLL_PAGE); }
@Test public void getWrongType() { bundle.putFloat("foo", 5f); assertThat(bundle.getCharArray("foo")).isNull(); assertThat(bundle.getInt("foo")).isEqualTo(0); assertThat(bundle.getIntArray("foo")).isNull(); assertThat(bundle.getIntegerArrayList("foo")).isNull(); assertThat(bundle.getShort("foo")).isEqualTo((short) 0); assertThat(bundle.getShortArray("foo")).isNull(); assertThat(bundle.getBoolean("foo")).isFalse(); assertThat(bundle.getBooleanArray("foo")).isNull(); assertThat(bundle.getLong("foo")).isEqualTo(0); assertThat(bundle.getLongArray("foo")).isNull(); assertThat(bundle.getFloatArray("foo")).isNull(); assertThat(bundle.getDouble("foo")).isEqualTo(0.0); assertThat(bundle.getDoubleArray("foo")).isNull(); assertThat(bundle.getString("foo")).isNull(); assertThat(bundle.getStringArray("foo")).isNull(); assertThat(bundle.getStringArrayList("foo")).isNull(); assertThat(bundle.getBundle("foo")).isNull(); assertThat((Parcelable) bundle.getParcelable("foo")).isNull(); assertThat(bundle.getParcelableArray("foo")).isNull(); assertThat(bundle.getParcelableArrayList("foo")).isNull(); bundle.putInt("foo", 1); assertThat(bundle.getFloat("foo")).isEqualTo(0.0f); }