本文整理汇总了Java中android.os.Bundle.putIntegerArrayList方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.putIntegerArrayList方法的具体用法?Java Bundle.putIntegerArrayList怎么用?Java Bundle.putIntegerArrayList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.putIntegerArrayList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showPrivateChatRoom
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void showPrivateChatRoom(DialogModel dialogModel) {
String tag = CHAT_ROOM_FR_TAG + dialogModel.getDialogId();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
Fragment fragment = getSupportFragmentManager().findFragmentByTag(tag);
if (fragment != null) {
transaction.replace(R.id.main_screen_container, fragment, tag)
.commit();
return;
}
fragment = new ChatRoomFragment();
Bundle args = new Bundle();
args.putString(ChatRoomFragment.DIALOG_ID_BUNDLE_KEY, dialogModel.getDialogId());
args.putLong(ChatRoomFragment.DIALOG_ADMIN_BUNDLE_KEY, dialogModel.getAdminId());
args.putString(ChatRoomFragment.DIALOG_NAME_BUNDLE_KEY, dialogModel.getName());
args.putInt(ChatRoomFragment.DIALOG_TYPE_BUNDLE_KEY, dialogModel.getType());
args.putString(ChatRoomFragment.DIALOG_ROOM_JID_BUNDLE_KEY, dialogModel.getXmppRoomJid());
ArrayList<Integer> list = new ArrayList<>(dialogModel.getOccupantsIds());
args.putIntegerArrayList(ChatRoomFragment.OCCUPANTS_IDS_BUNDLE_KEY, list);
fragment.setArguments(args);
transaction.replace(R.id.main_screen_container, fragment, tag)
.addToBackStack(null)
.commit();
}
示例2: showPublicChatRoom
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void showPublicChatRoom(DialogModel dialogModel) {
String tag = CHAT_ROOM_FR_TAG + dialogModel.getDialogId();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
Fragment fragment = getSupportFragmentManager().findFragmentByTag(tag);
if (fragment != null) {
transaction.replace(R.id.main_screen_container, fragment, tag)
.commit();
return;
}
fragment = new ChatRoomFragment();
Bundle args = new Bundle();
args.putString(ChatRoomFragment.DIALOG_ID_BUNDLE_KEY, dialogModel.getDialogId());
args.putLong(ChatRoomFragment.DIALOG_ADMIN_BUNDLE_KEY, dialogModel.getAdminId());
args.putString(ChatRoomFragment.DIALOG_NAME_BUNDLE_KEY, dialogModel.getName());
args.putInt(ChatRoomFragment.DIALOG_TYPE_BUNDLE_KEY, dialogModel.getType());
args.putString(ChatRoomFragment.DIALOG_ROOM_JID_BUNDLE_KEY, dialogModel.getXmppRoomJid());
ArrayList<Integer> list = new ArrayList<>(dialogModel.getOccupantsIds());
args.putIntegerArrayList(ChatRoomFragment.OCCUPANTS_IDS_BUNDLE_KEY, list);
fragment.setArguments(args);
transaction.replace(R.id.main_screen_container, fragment, tag)
.addToBackStack(null)
.commit();
}
示例3: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
public void onSaveInstanceState(@NonNull Bundle outState) {
if (this.mTimePicker != null) {
outState.putInt(KEY_HOUR_OF_DAY, this.mTimePicker.getHours());
outState.putInt("minute", this.mTimePicker.getMinutes());
outState.putBoolean(KEY_IS_24_HOUR_VIEW, this.mIs24HourMode);
outState.putInt(KEY_CURRENT_ITEM_SHOWING, this.mTimePicker.getCurrentItemShowing());
outState.putBoolean(KEY_IN_KB_MODE, this.mInKbMode);
if (this.mInKbMode) {
outState.putIntegerArrayList(KEY_TYPED_TIMES, this.mTypedTimes);
}
outState.putString(KEY_TITLE, this.mTitle);
outState.putBoolean(KEY_DARK_THEME, this.mThemeDark);
outState.putInt(KEY_ACCENT, this.mAccentColor);
outState.putBoolean(KEY_VIBRATE, this.mVibrate);
outState.putBoolean(KEY_DISMISS, this.mDismissOnPause);
}
}
示例4: startLocalSearch
import android.os.Bundle; //导入方法依赖的package包/类
private void startLocalSearch(String SearchQuery) {
Bundle bundle = new Bundle();
bundle.putBoolean(ARG_IS_GLOBAL_SEARCH, false);
ArrayList<Integer> bookIds = new ArrayList<>();
bookIds.add(bookId);
bundle.putIntegerArrayList(SearchResultFragment.ARG_SEARCHABLE_BOOKS, bookIds);
bundle.putString(SearchManager.QUERY, SearchQuery);
Fragment searchResultFragment = SearchResultFragment.newInstance(bundle);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.search_result_fragment_containerr, searchResultFragment, SEARCH_FRAGMENT_TAG)
.hide(searchResultFragment)
.addToBackStack(ADD_SEARCH_FRAGMENT_BACK_STACK_ENTRY)
.commit()
;
getSupportFragmentManager()
.beginTransaction()
.show(searchResultFragment)
.addToBackStack(SHOW_SEARCH_FRAGMENT_BACKSTACK_ENTRY)
.commit();
}
示例5: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
if (mTimePicker != null) {
outState.putInt(KEY_HOUR_OF_DAY, mTimePicker.getHours());
outState.putInt(KEY_MINUTE, mTimePicker.getMinutes());
outState.putBoolean(KEY_IS_24_HOUR_VIEW, mIs24HourMode);
outState.putInt(KEY_CURRENT_ITEM_SHOWING, mTimePicker.getCurrentItemShowing());
outState.putBoolean(KEY_IN_KB_MODE, mInKbMode);
if (mInKbMode) {
outState.putIntegerArrayList(KEY_TYPED_TIMES, mTypedTimes);
}
outState.putBoolean(KEY_DARK_THEME, mThemeDark);
}
}
示例6: startSearch
import android.os.Bundle; //导入方法依赖的package包/类
protected void startSearch(String SearchQuery) {
Intent searchIntent = new Intent(this, SearchResultActivity.class);
searchIntent.setAction(Intent.ACTION_SEARCH);
Bundle bundle = new Bundle();
bundle.putBoolean(ARG_IS_GLOBAL_SEARCH, true);
ArrayList<Integer> selectedSearchableBooks = new ArrayList<>();
if (shouldDisplayDownloadedOnly()) {
selectedSearchableBooks.addAll(selectedBooksIds);
} else {
HashSet<Integer> downloadedHashSet = mBooksInformationDbHelper.getBookIdsDownloadedOnly();
downloadedHashSet.retainAll(selectedBooksIds);
if (downloadedHashSet.size() == 0) {
Toast.makeText(this, R.string.no_downloaded_selected_books, Toast.LENGTH_SHORT).show();
return;
} else {
if (downloadedHashSet.size() < selectedBooksIds.size()) {
Toast.makeText(this, R.string.searching_downloaded_only, Toast.LENGTH_SHORT).show();
}
selectedSearchableBooks.addAll(downloadedHashSet);
}
}
bundle.putIntegerArrayList(SearchResultFragment.ARG_SEARCHABLE_BOOKS, selectedSearchableBooks);
bundle.putString(SearchManager.QUERY, SearchQuery);
searchIntent.putExtras(bundle);
startActivity(searchIntent);
}
示例7: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
public static SearchResultFragment newInstance(boolean isGlobalSearch, ArrayList<Integer> searchableBooksIds) {
SearchResultFragment fragment = new SearchResultFragment();
Bundle args = new Bundle();
args.putBoolean(ARG_IS_GLOBAL_SEARCH, isGlobalSearch);
args.putIntegerArrayList(ARG_SEARCHABLE_BOOKS, searchableBooksIds);
fragment.setArguments(args);
return fragment;
}
示例8: onSave
import android.os.Bundle; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@CallSuper
@Override
protected void onSave(Bundle state) {
for (int i = requested.size() - 1; i >= 0; i--) {
int restartableId = requested.get(i);
Subscription subscription = restartableSubscriptions.get(restartableId);
if (subscription != null && subscription.isUnsubscribed())
requested.remove(i);
}
state.putIntegerArrayList(REQUESTED_KEY, requested);
}
示例9: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (adapter != null) {
selectedContacts = adapter.getSelectedContactIds();
outState.putIntegerArrayList(CONTACTS,
getContactsFromIds(selectedContacts));
}
}
示例10: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (groupId != null) {
// save the group ID here regardless of how subclasses initialize it
outState.putByteArray(GROUP_ID, groupId.getBytes());
}
if (contacts != null) {
outState.putIntegerArrayList(CONTACTS,
getContactsFromIds(contacts));
}
}
示例11: showPublicChatRoom
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void showPublicChatRoom(DialogModel dialogModel) {
String tag = CHAT_ROOM_FR_TAG + dialogModel.getDialogId();
FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
Fragment fragment = getActivity().getSupportFragmentManager().findFragmentByTag(tag);
getActivity().getSupportFragmentManager().popBackStackImmediate();
if (fragment != null) {
transaction.replace(R.id.main_screen_container, fragment, tag)
.commit();
return;
}
fragment = new ChatRoomFragment();
Bundle args = new Bundle();
args.putString(ChatRoomFragment.DIALOG_ID_BUNDLE_KEY, dialogModel.getDialogId());
args.putLong(ChatRoomFragment.DIALOG_ADMIN_BUNDLE_KEY, dialogModel.getAdminId());
args.putString(ChatRoomFragment.DIALOG_NAME_BUNDLE_KEY, dialogModel.getName());
args.putInt(ChatRoomFragment.DIALOG_TYPE_BUNDLE_KEY, dialogModel.getType());
args.putString(ChatRoomFragment.DIALOG_ROOM_JID_BUNDLE_KEY, dialogModel.getXmppRoomJid());
ArrayList<Integer> list = new ArrayList<>(dialogModel.getOccupantsIds());
args.putIntegerArrayList(ChatRoomFragment.OCCUPANTS_IDS_BUNDLE_KEY, list);
fragment.setArguments(args);
transaction.replace(R.id.main_screen_container, fragment, tag)
.addToBackStack(null)
.commit();
}
示例12: write
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void write(Bundle bundle, Object to, StateField field) throws IllegalAccessException {
Field propertyField = field.getField();
propertyField.setAccessible(true);
bundle.putIntegerArrayList(field.getBundleKey(), (ArrayList<Integer>) propertyField.get(to));
}
示例13: createWithRes
import android.os.Bundle; //导入方法依赖的package包/类
public static SliderFragment createWithRes(ArrayList<Integer> imagesRes) {
SliderFragment fragment = new SliderFragment();
Bundle args = new Bundle();
args.putIntegerArrayList(ALL_IMAGE_RES, imagesRes);
fragment.setArguments(args);
return fragment;
}
示例14: putIntegerArrayList
import android.os.Bundle; //导入方法依赖的package包/类
public void putIntegerArrayList(Bundle state, String key, ArrayList<Integer> x) {
state.putIntegerArrayList(key + baseKey, x);
}
示例15: put
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void put(@NonNull String key, @NonNull List<Integer> value, @NonNull Bundle bundle) {
ArrayList<Integer> arrayList = value instanceof ArrayList ? (ArrayList<Integer>) value : new ArrayList<>(value);
bundle.putIntegerArrayList(key, arrayList);
}