@Override protected void onRestoreInstanceState(Bundle inState) { middleContents=inState.getStringArrayList(KEY_MIDDLE_CONTENTS); }
void onRestoreInstanceState(Bundle state) { buffers=state.getStringArrayList(STATE_BUFFERS); } }
void onRestoreInstanceState(Bundle state) { buffers=state.getStringArrayList(STATE_BUFFERS); } }
@Override protected void onRestoreInstanceState(Bundle inState) { middleContents=inState.getStringArrayList(KEY_MIDDLE_CONTENTS); }
void onRestoreInstanceState(Bundle state) { buffers=state.getStringArrayList(STATE_BUFFERS); } }
/** * Gets an array of string values out of the object. * @param key The key for the value. * @return The string values. */ @Nullable public ArrayList<String> getStringArrayList(final String key) { return this.bundle.getStringArrayList(key); }
protected void onRestore(@NonNull Bundle savedInstanceState) { mKeys = savedInstanceState.getStringArrayList(KEY_KEYS); mValues = savedInstanceState.getStringArrayList(KEY_VALUES); }
@Override public void restoreFromBundle(@NonNull Bundle bundle) { List<String> savedNames = bundle.getStringArrayList(KEY_WAIT_FOR_TRANSITION_NAMES); if (savedNames != null) { names.addAll(savedNames); } }
static List<String> getPermissionsFromBundle(Bundle bundle, String key) { // Copy the list so we can guarantee immutable List<String> originalPermissions = bundle.getStringArrayList(key); List<String> permissions; if (originalPermissions == null) { permissions = Collections.emptyList(); } else { permissions = Collections.unmodifiableList(new ArrayList<String>(originalPermissions)); } return permissions; }
@Override public void onRestoreInstanceState(Bundle state) { adapter.onRestoreInstanceState(state); items=state.getStringArrayList(STATE_ITEMS); }
public static Set<String> getPermissions(Bundle bundle) { Validate.notNull(bundle, "bundle"); ArrayList<String> arrayList = bundle.getStringArrayList(PERMISSIONS_KEY); if (arrayList == null) { return null; } return new HashSet<String>(arrayList); }
@Override protected void onRestoreInstanceState(Bundle state) { super.onRestoreInstanceState(state); exportGlobalSettings = state.getBoolean(STATE_EXPORT_GLOBAL_SETTINGS, false); exportAccountUuids = state.getStringArrayList(STATE_EXPORT_ACCOUNTS); }
@Override public void restoreFromBundle(@NonNull Bundle bundle) { super.restoreFromBundle(bundle); sharedElementNames.addAll(bundle.getStringArrayList(KEY_SHARED_ELEMENT_NAMES)); }
@Implementation protected WebBackForwardList restoreState(Bundle inState) { history = inState.getStringArrayList(HISTORY_KEY); if (history != null && history.size() > 0) { originalUrl = history.get(0); lastUrl = history.get(0); return new BackForwardList(history); } return null; }
@Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { if (savedInstanceState == null) { initAdapter(null); } else { initAdapter(savedInstanceState.getStringArrayList(STATE_MODEL)); initialQuery=savedInstanceState.getCharSequence(STATE_QUERY); } }
@Test public void stringArrayList() { ArrayList<String> list = new ArrayList<>(); list.add("a"); bundle.putStringArrayList("foo", new ArrayList<>(list)); assertThat(bundle.getStringArrayList("foo")).isEqualTo(list); assertThat(bundle.getStringArrayList("bar")).isNull(); }
@Test public void putStringArrayListExtra_addsListToExtras() { Intent intent = new Intent(); final ArrayList<String> strings = new ArrayList<>(Arrays.asList("hi", "there")); intent.putStringArrayListExtra("KEY", strings); assertThat(intent.getStringArrayListExtra("KEY")).isEqualTo(strings); assertThat(intent.getExtras().getStringArrayList("KEY")).isEqualTo(strings); }
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); setContents(getArguments().getStringArrayList(KEY_CONTENTS)); }
@Override public void onViewCreated(View v, Bundle savedInstanceState) { super.onViewCreated(v, savedInstanceState); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); setContents(getArguments().getStringArrayList(KEY_CONTENTS)); }
@Override public void onCreate(Bundle state) { super.onCreate(state); if (state == null) { initAdapter(null); } else { initAdapter(state.getStringArrayList(STATE_MODEL)); } getListView().setOnItemLongClickListener(this); getListView().setMultiChoiceModeListener(this); int choiceMode= (state == null ? ListView.CHOICE_MODE_NONE : state.getInt(STATE_CHOICE_MODE)); getListView().setChoiceMode(choiceMode); }