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

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

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

Bundle.getIntegerArrayList介绍

暂无

代码示例

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

@Override
public void restoreState(Parcelable state, ClassLoader loader) {
  Bundle bundle = (Bundle)state;
  if (state != null) {
    savedPages = bundle.getSparseParcelableArray(KEY_SAVED_PAGES);
    maxPagesToStateSave = bundle.getInt(KEY_MAX_PAGES_TO_STATE_SAVE);
    savedPageHistory = bundle.getIntegerArrayList(KEY_SAVE_PAGE_HISTORY);
  }
}

代码示例来源:origin: konmik/nucleus

/**
 * {@inheritDoc}
 */
@CallSuper
@Override
protected void onCreate(Bundle savedState) {
  if (savedState != null)
    requested.addAll(savedState.getIntegerArrayList(REQUESTED_KEY));
}

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

@Test
public void intArrayList() {
 ArrayList<Integer> list = new ArrayList<>();
 list.add(100);
 bundle.putIntegerArrayList("foo", new ArrayList<>(list));
 assertThat(bundle.getIntegerArrayList("foo")).isEqualTo(list);
 assertThat(bundle.getIntegerArrayList("bar")).isNull();
}

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

@Test
public void putIntegerArrayListExtra_addsListToExtras() {
 Intent intent = new Intent();
 final ArrayList<Integer> integers = new ArrayList<>(Arrays.asList(100, 200, 300));
 intent.putIntegerArrayListExtra("KEY", integers);
 assertThat(intent.getIntegerArrayListExtra("KEY")).isEqualTo(integers);
 assertThat(intent.getExtras().getIntegerArrayList("KEY")).isEqualTo(integers);
}

代码示例来源:origin: konmik/nucleus

when(bundle.getIntegerArrayList(anyString())).thenAnswer(get);

代码示例来源:origin: iSoron/uhabits

generateLegalTimesTree();
if (mInKbMode) {
  mTypedTimes = savedInstanceState.getIntegerArrayList(KEY_TYPED_TIMES);
  tryStartingKbMode(-1);
  mHourView.invalidate();

代码示例来源:origin: wdullaer/MaterialDateTimePicker

generateLegalTimesTree();
if (mInKbMode && savedInstanceState != null) {
  mTypedTimes = savedInstanceState.getIntegerArrayList(KEY_TYPED_TIMES);
  tryStartingKbMode(-1);
  mHourView.invalidate();

代码示例来源:origin: wangdan/AisenWeiBo

generateLegalTimesTree();
if (mInKbMode) {
  mTypedTimes = savedInstanceState.getIntegerArrayList(KEY_TYPED_TIMES);
  tryStartingKbMode(-1);
  mHourView.invalidate();

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

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

代码示例来源:origin: kayoSun/Tack

public ArrayList<Integer> getIntArrayList(String key){
  if (mBundle != null) {
    return mBundle.getIntegerArrayList(key);
  }
  return null;
}
public ArrayList<Parcelable> getParcelableArrayList(String key){

代码示例来源:origin: fengdai/FragmentMaster

/**
 * Retrieve extended data from the request.
 *
 * @param name The name of the desired item.
 * @return the value of an item that previously added with putExtra() or
 * null if no ArrayList<Integer> value was found.
 * @see #putIntegerArrayListExtra(String, ArrayList)
 */
public ArrayList<Integer> getIntegerArrayListExtra(String name) {
  return mExtras == null ? null : mExtras.getIntegerArrayList(name);
}

代码示例来源:origin: Workday/postman

@Override
  public ArrayList<Integer> readFromBundle(Bundle bundle, String key) {
    return bundle.getIntegerArrayList(key);
  }
};

代码示例来源:origin: com.workday/postman

@Override
  public ArrayList<Integer> readFromBundle(Bundle bundle, String key) {
    return bundle.getIntegerArrayList(key);
  }
};

代码示例来源:origin: schaal/ocreader

public void onRestoreInstanceState(Bundle bundle) {
    final ArrayList<Integer> savedSelections = bundle.getIntegerArrayList("adapter_selections");
    if(savedSelections != null) {
      selections.addAll(savedSelections);
    }
  }
}

代码示例来源:origin: stackoverflow.com

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_three_sign_game);

  // here
   Bundle extras = getIntent().getExtras();

   ArrayList<Integer> players = extras.getIntegerArrayList("players");
   int currentPlayer = extras.getInt("newPlayerNum");
}

代码示例来源:origin: evernote/android-state

@Nullable
  @Override
  public List<Integer> get(@NonNull String key, @NonNull Bundle bundle) {
    return bundle.getIntegerArrayList(key);
  }
}

代码示例来源:origin: TobiasBielefeld/Simple-Solitaire

@Override
protected void loadState(Bundle bundle) {
  counter = bundle.getInt("BUNDLE_HINT_COUNTER");
  ArrayList<Integer> list = bundle.getIntegerArrayList("BUNDLE_HINT_VISITED");
  visited.clear();
  if (list != null) {
    for (Integer i : list) {
      visited.add(cards[i]);
    }
  }
}

代码示例来源:origin: stackoverflow.com

Bundle contactRequest;

Bundle extras = getIntent().getExtras();
if (extras != null) {
  contactRequest = extras.getBundle("contactRequest");

  // then get all the stuff you placed there the same way
  idAccList = contactRequest .getIntegerArrayList("idAccList");

  ...
}

代码示例来源:origin: WireGuard/wireguard-android

@Override
public void onActivityCreated(@Nullable final Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  if (savedInstanceState != null) {
    final Collection<Integer> checkedItems = savedInstanceState.getIntegerArrayList("CHECKED_ITEMS");
    if (checkedItems != null) {
      for (final Integer i : checkedItems)
        actionModeListener.setItemChecked(i, true);
    }
  }
}

代码示例来源:origin: first087/Android-License-Fragment

protected void onFirstTimeLaunched() {
  boolean haveArgument = (getArguments() != null && getArguments().getIntegerArrayList(ARG_LICENSE_IDS) != null);
  mLicenses.addAll(haveArgument ? getArguments().getIntegerArrayList(ARG_LICENSE_IDS) : new ArrayList<Integer>());
  addLicensesFromFlag();
  LicenseManager licenseManager = new LicenseManager(getActivity().getApplicationContext());
  ArrayList<License> licenses = licenseManager.withLicenseChain(mLicenseChain).getLicenses(mLicenses);
  if (mCustomLicenses != null) licenses.addAll(mCustomLicenses);
  if (isLog) Log.i(TAG, "Call -> onFirstTimeLaunched(ArrayList<License>)");
  onFirstTimeLaunched(licenses);
}

相关文章

Bundle类方法