android.os.Bundle.getStringArrayList()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(223)

本文整理了Java中android.os.Bundle.getStringArrayList()方法的一些代码示例,展示了Bundle.getStringArrayList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.getStringArrayList()方法的具体详情如下:
包路径:android.os.Bundle
类名称:Bundle
方法名:getStringArrayList

Bundle.getStringArrayList介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

@Override
protected void onRestoreInstanceState(Bundle inState) {
 middleContents=inState.getStringArrayList(KEY_MIDDLE_CONTENTS);
}

代码示例来源:origin: commonsguy/cw-omnibus

void onRestoreInstanceState(Bundle state) {
  buffers=state.getStringArrayList(STATE_BUFFERS);
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

void onRestoreInstanceState(Bundle state) {
  buffers=state.getStringArrayList(STATE_BUFFERS);
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
protected void onRestoreInstanceState(Bundle inState) {
 middleContents=inState.getStringArrayList(KEY_MIDDLE_CONTENTS);
}

代码示例来源:origin: commonsguy/cw-omnibus

void onRestoreInstanceState(Bundle state) {
  buffers=state.getStringArrayList(STATE_BUFFERS);
 }
}

代码示例来源:origin: facebook/facebook-android-sdk

/**
 * 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);
}

代码示例来源:origin: seven332/EhViewer

protected void onRestore(@NonNull Bundle savedInstanceState) {
  mKeys = savedInstanceState.getStringArrayList(KEY_KEYS);
  mValues = savedInstanceState.getStringArrayList(KEY_VALUES);
}

代码示例来源:origin: bluelinelabs/Conductor

@Override
public void restoreFromBundle(@NonNull Bundle bundle) {
  List<String> savedNames = bundle.getStringArrayList(KEY_WAIT_FOR_TRANSITION_NAMES);
  if (savedNames != null) {
    names.addAll(savedNames);
  }
}

代码示例来源:origin: facebook/facebook-android-sdk

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;
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onRestoreInstanceState(Bundle state) {
 adapter.onRestoreInstanceState(state);
 items=state.getStringArrayList(STATE_ITEMS);
}

代码示例来源:origin: facebook/facebook-android-sdk

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);
}

代码示例来源:origin: k9mail/k-9

@Override
protected void onRestoreInstanceState(Bundle state) {
  super.onRestoreInstanceState(state);
  exportGlobalSettings = state.getBoolean(STATE_EXPORT_GLOBAL_SETTINGS, false);
  exportAccountUuids = state.getStringArrayList(STATE_EXPORT_ACCOUNTS);
}

代码示例来源:origin: bluelinelabs/Conductor

@Override
public void restoreFromBundle(@NonNull Bundle bundle) {
  super.restoreFromBundle(bundle);
  sharedElementNames.addAll(bundle.getStringArrayList(KEY_SHARED_ELEMENT_NAMES));
}

代码示例来源:origin: robolectric/robolectric

@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;
}

代码示例来源:origin: commonsguy/cw-omnibus

@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);
 }
}

代码示例来源:origin: robolectric/robolectric

@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();
}

代码示例来源:origin: robolectric/robolectric

@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);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
 super.onViewCreated(view, savedInstanceState);
 getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
 setContents(getArguments().getStringArrayList(KEY_CONTENTS));
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onViewCreated(View v, Bundle savedInstanceState) {
 super.onViewCreated(v, savedInstanceState);
 getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
 setContents(getArguments().getStringArrayList(KEY_CONTENTS));
}

代码示例来源:origin: commonsguy/cw-omnibus

@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);
}

相关文章

Bundle类方法