Java Code Examples for android.os.Bundle#putIntegerArrayList()

The following examples show how to use android.os.Bundle#putIntegerArrayList() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public static SelectDeviceDialog newDialog(int titleInfo, int descriptionInfo, List<Pair<Integer, Integer>> profilesInfo, BlueToothService.GattConnectType connectType) {
    SelectDeviceDialog dialog = new SelectDeviceDialog();

    Bundle args = new Bundle();
    args.putInt(TITLE_INFO, titleInfo);
    args.putInt(DESC_INFO, descriptionInfo);

    ArrayList<Integer> profilesInfoList = new ArrayList<>();
    if (profilesInfo != null) {
        for (Pair<Integer, Integer> profileInfo : profilesInfo) {
            profilesInfoList.add(profileInfo.first);
            profilesInfoList.add(profileInfo.second);
        }
    }
    args.putIntegerArrayList(PROFILES_INFO, profilesInfoList);
    if (connectType != null) {
        args.putInt(CONN_TYPE_INFO, connectType.ordinal());
    }

    dialog.setArguments(args);
    return dialog;
}
 
Example 2
public static SelectDeviceDialog newDialog(int titleInfo, int descriptionInfo, List<Pair<Integer, Integer>> profilesInfo, BlueToothService.GattConnectType connectType) {
    SelectDeviceDialog dialog = new SelectDeviceDialog();

    Bundle args = new Bundle();
    args.putInt(TITLE_INFO, titleInfo);
    args.putInt(DESC_INFO, descriptionInfo);

    ArrayList<Integer> profilesInfoList = new ArrayList<>();
    if (profilesInfo != null) {
        for (Pair<Integer, Integer> profileInfo : profilesInfo) {
            profilesInfoList.add(profileInfo.first);
            profilesInfoList.add(profileInfo.second);
        }
    }
    args.putIntegerArrayList(PROFILES_INFO, profilesInfoList);
    if (connectType != null) {
        args.putInt(CONN_TYPE_INFO, connectType.ordinal());
    }

    dialog.setArguments(args);
    return dialog;
}
 
Example 3
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();

}
 
Example 4
Source Project: nucleus   File: RxPresenter.java    License: MIT License 5 votes vote down vote up
/**
 * {@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);
}
 
Example 5
/**
 * Factory method to create and display the {@link RingtonePickerDialog}.
 *
 * @param fragmentManager    Support {@link FragmentManager}.
 * @param title              Title of the dialog.
 * @param positiveButtonText Title for the positive button.
 * @param negativeButtonText Title for the negative button.
 * @param ringtoneTypes      {@link java.util.List} of the {@link RingtoneTypes} to display.
 * @param currentUri         Current ringtone {@link Uri}.
 * @param listener           {@link RingtonePickerListener} to get notify when new ringtone is
 *                           selected.
 * @param isPlaySample       True if the dialog should play sample ringtone else false.
 */
private static void launchRingtonePicker(@NonNull final FragmentManager fragmentManager,
                                         @Nullable final String title,
                                         @NonNull final String positiveButtonText,
                                         @Nullable final String negativeButtonText,
                                         @NonNull final ArrayList<Integer> ringtoneTypes,
                                         @Nullable final String currentUri,
                                         @NonNull final RingtonePickerListener listener,
                                         final boolean isPlaySample,
                                         final boolean isDisplayDefault,
                                         final boolean isDisplaySilent) {

    // Prepare arguments bundle
    Bundle bundle = new Bundle();
    bundle.putString(ARG_DIALOG_TITLE, title);
    bundle.putString(ARG_DIALOG_POSITIVE, positiveButtonText);
    bundle.putString(ARG_DIALOG_NEGATIVE, negativeButtonText);
    bundle.putIntegerArrayList(ARG_RINGTONE_TYPES, ringtoneTypes);
    bundle.putString(ARG_CURRENT_URI, currentUri);
    bundle.putBoolean(ARG_IS_PLAY, isPlaySample);
    bundle.putBoolean(ARG_IS_DISPLAY_DEFAULT, isDisplayDefault);
    bundle.putBoolean(ARG_IS_DISPLAY_SILENT, isDisplaySilent);
    bundle.putSerializable(ARG_LISTENER, listener);

    RingtonePickerDialog ringtonePickerDialog = new RingtonePickerDialog();
    ringtonePickerDialog.setRetainInstance(true);
    ringtonePickerDialog.setArguments(bundle);
    ringtonePickerDialog.show(fragmentManager, RingtonePickerDialog.class.getSimpleName());
}
 
Example 6
public void onSaveInstanceState(@NonNull Bundle bundle) {
  List<Field> fields = getSelectedFields();

  ArrayList<Integer> serializedFields = new ArrayList<>();
  for (Field field : fields) {
    serializedFields.add(field.ordinal());
  }
  bundle.putIntegerArrayList(SELECTED_PLACE_FIELDS_KEY, serializedFields);
}
 
Example 7
@Override
public void onSaveInstanceState(Bundle outState)
{
    ArrayList<Integer> ids = new ArrayList<>();
    for (ILayer layer : mLayers) {
        ids.add(layer.getId());
    }
    outState.putIntegerArrayList(KEY_LAYERS_IDS, ids);
    outState.putInt(KEY_CODE, mCode);
    super.onSaveInstanceState(outState);
}
 
Example 8
@Override
protected Parcelable onSaveInstanceState() {
    Bundle bundle = (Bundle) super.onSaveInstanceState();
    if (bundle != null)
        bundle.putIntegerArrayList(BUNDLE_DELETED_IMAGES, new ArrayList<>(getDeletedAttaches()));
    return bundle;
}
 
Example 9
/**
 * Save elements for view
 * @param outState
 */
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.putBoolean(KEY_HIGHLIGHT_SELECTED_AM_PM_VIEW, mHighlightAMPMSelection);
        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_VIBRATE, mVibrate);
    }
}
 
Example 10
/**
 * Saves the state of the current selection on the items.
 *
 * @param outState Current state
 * @since 1.0.0
 */
public void onSaveInstanceState(Bundle outState) {
    outState.putIntegerArrayList(TAG, new ArrayList<>(mSelectedPositions));
    if (getSelectedItemCount() > 0) {
        log.d("Saving selection %s", mSelectedPositions);
    }
}
 
Example 11
Source Project: android_external_GmsLib   File: DataMap.java    License: Apache License 2.0 4 votes vote down vote up
public Bundle toBundle() {
    Bundle bundle = new Bundle();
    for (String key : data.keySet()) {
        switch (types.get(key)) {
            case Asset:
                bundle.putParcelable(key, (Asset) data.get(key));
                break;
            case Boolean:
                bundle.putBoolean(key, (Boolean) data.get(key));
                break;
            case Byte:
                bundle.putByte(key, (Byte) data.get(key));
                break;
            case ByteArray:
                bundle.putByteArray(key, (byte[]) data.get(key));
                break;
            case DataMap:
                bundle.putBundle(key, ((DataMap) data.get(key)).toBundle());
                break;
            case DataMapArrayList:
                ArrayList<Bundle> bundles = new ArrayList<Bundle>();
                for (DataMap dataMap : ((ArrayList<DataMap>) data.get(key))) {
                    bundles.add(dataMap.toBundle());
                }
                bundle.putParcelableArrayList(key, bundles);
                break;
            case Double:
                bundle.putDouble(key, (Double) data.get(key));
                break;
            case Float:
                bundle.putFloat(key, (Float) data.get(key));
                break;
            case FloatArray:
                bundle.putFloatArray(key, (float[]) data.get(key));
                break;
            case Integer:
                bundle.putInt(key, (Integer) data.get(key));
                break;
            case IntegerArrayList:
                bundle.putIntegerArrayList(key, (ArrayList<Integer>) data.get(key));
                break;
            case Long:
                bundle.putLong(key, (Long) data.get(key));
                break;
            case LongArray:
                bundle.putLongArray(key, (long[]) data.get(key));
                break;
            case String:
                bundle.putString(key, (String) data.get(key));
                break;
            case StringArray:
                bundle.putStringArray(key, (String[]) data.get(key));
                break;
            case StringArrayList:
                bundle.putStringArrayList(key, (ArrayList<String>) data.get(key));
                break;
        }
    }
    return bundle;
}
 
Example 12
@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putIntegerArrayList(GROUPS_KEY, mAdapter.saveGroups());
    super.onSaveInstanceState(outState);
}
 
Example 13
@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putIntegerArrayList("dataset", sDataSet);
}
 
Example 14
protected static LicenseFragmentBase onNewInstance(LicenseFragmentBase fragment, int[] licenseIDs) {
    Bundle bundle = new Bundle();
    bundle.putIntegerArrayList(ARG_LICENSE_IDS, ArrayManager.asIntegerArrayList(licenseIDs));
    fragment.setArguments(bundle);
    return fragment;
}
 
Example 15
/**
 * 将各种坐标和参数放入bundle中传递
 * 
    * Returns the created options as a Bundle, which can be passed to
    * {@link android.content.Context#startActivity(android.content.Intent, android.os.Bundle)
    * Context.startActivity(Intent, Bundle)} and related methods.
    * Note that the returned Bundle is still owned by the ActivityOptions
    * object; you must not modify it, but can supply it to the startActivity
    * methods that take an options Bundle.
    */
public Bundle toBundle() {
	if (mAnimationType == ANIM_DEFAULT) {
           return null;
       }
	Bundle bundle = new Bundle();
       bundle.putInt(KEY_ANIM_TYPE, mAnimationType);
       switch (mAnimationType) {
       
           case ANIM_CUSTOM:
           	bundle.putInt(KEY_ANIM_ENTER_RES_ID, mCustomEnterResId);
               bundle.putInt(KEY_ANIM_EXIT_RES_ID, mCustomExitResId);
               break;
               
           case ANIM_SCALE_UP:
       		bundle.putBoolean(KEY_IS_VERTICAL_SCREEN, mIsVerticalScreen);
       		bundle.putBoolean(KEY_IS_IN_THE_SCREEN, mIsInTheScreen);
       		
       		bundle.putInt(KEY_ANIM_WIDTH, mWidth);
       		bundle.putInt(KEY_ANIM_HEIGHT, mHeight);
       		bundle.putInt(KEY_ANIM_START_X, mStartX);
       		bundle.putInt(KEY_ANIM_START_Y, mStartY);
               break;
               
           case ANIM_THUMBNAIL_SCALE_UP:
           	bundle.putBoolean(KEY_IS_START_FULL_SCREEN, mIsStartFullScreen);
           	bundle.putBoolean(KEY_IS_VERTICAL_SCREEN, mIsVerticalScreen);
       		bundle.putBoolean(KEY_IS_IN_THE_SCREEN, mIsInTheScreen);
               bundle.putParcelable(KEY_ANIM_THUMBNAIL, mThumbnail);
               bundle.putInt(KEY_ANIM_START_X, mStartX);
               bundle.putInt(KEY_ANIM_START_Y, mStartY);
               bundle.putInt(KEY_ANIM_WIDTH, mWidth);
               bundle.putInt(KEY_ANIM_HEIGHT, mHeight);
               break;
               
           case ANIM_SCENE_TRANSITION:
       		bundle.putBoolean(KEY_IS_VERTICAL_SCREEN, mIsVerticalScreen);
       		bundle.putBoolean(KEY_IS_START_FULL_SCREEN, mIsStartFullScreen);
       		
       		bundle.putBooleanArray(kEY_IS_IN_THE_SCREEN_ARR, mIsInTheScreenArr);
       		bundle.putIntegerArrayList(kEY_SHARED_ELEMENT_ID_LIST, mSharedElementIds);
       		bundle.putParcelableArrayList(kEY_SHARED_ELEMENT_BOUNDS_LIST, mSharedElementBounds);
               break;
       }

	return bundle;
}
 
Example 16
@Override
protected Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putIntegerArrayList("arrayList", mPercentages);
    return super.onSaveInstanceState();
}
 
Example 17
@Override
protected Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putIntegerArrayList("arrayList", mPercentages);
    return super.onSaveInstanceState();
}
 
Example 18
/**
 * 将各种坐标和参数放入bundle中传递
 * 
    * Returns the created options as a Bundle, which can be passed to
    * {@link android.content.Context#startActivity(android.content.Intent, android.os.Bundle)
    * Context.startActivity(Intent, Bundle)} and related methods.
    * Note that the returned Bundle is still owned by the ActivityOptions
    * object; you must not modify it, but can supply it to the startActivity
    * methods that take an options Bundle.
    */
public Bundle toBundle() {
	if (mAnimationType == ANIM_DEFAULT) {
           return null;
       }
	Bundle bundle = new Bundle();
       bundle.putInt(KEY_ANIM_TYPE, mAnimationType);
       switch (mAnimationType) {
       
           case ANIM_CUSTOM:
           	bundle.putInt(KEY_ANIM_ENTER_RES_ID, mCustomEnterResId);
               bundle.putInt(KEY_ANIM_EXIT_RES_ID, mCustomExitResId);
               break;
               
           case ANIM_SCALE_UP:
       		bundle.putBoolean(KEY_IS_VERTICAL_SCREEN, mIsVerticalScreen);
       		bundle.putBoolean(KEY_IS_IN_THE_SCREEN, mIsInTheScreen);
       		
       		bundle.putInt(KEY_ANIM_WIDTH, mWidth);
       		bundle.putInt(KEY_ANIM_HEIGHT, mHeight);
       		bundle.putInt(KEY_ANIM_START_X, mStartX);
       		bundle.putInt(KEY_ANIM_START_Y, mStartY);
               break;
               
           case ANIM_THUMBNAIL_SCALE_UP:
           	bundle.putBoolean(KEY_IS_START_FULL_SCREEN, mIsStartFullScreen);
           	bundle.putBoolean(KEY_IS_VERTICAL_SCREEN, mIsVerticalScreen);
       		bundle.putBoolean(KEY_IS_IN_THE_SCREEN, mIsInTheScreen);
               bundle.putParcelable(KEY_ANIM_THUMBNAIL, mThumbnail);
               bundle.putInt(KEY_ANIM_START_X, mStartX);
               bundle.putInt(KEY_ANIM_START_Y, mStartY);
               bundle.putInt(KEY_ANIM_WIDTH, mWidth);
               bundle.putInt(KEY_ANIM_HEIGHT, mHeight);
               break;
               
           case ANIM_SCENE_TRANSITION:
       		bundle.putBoolean(KEY_IS_VERTICAL_SCREEN, mIsVerticalScreen);
       		bundle.putBoolean(KEY_IS_START_FULL_SCREEN, mIsStartFullScreen);
       		
       		bundle.putBooleanArray(kEY_IS_IN_THE_SCREEN_ARR, mIsInTheScreenArr);
       		bundle.putIntegerArrayList(kEY_SHARED_ELEMENT_ID_LIST, mSharedElementIds);
       		bundle.putParcelableArrayList(kEY_SHARED_ELEMENT_BOUNDS_LIST, mSharedElementBounds);
               break;
       }

	return bundle;
}
 
Example 19
protected static LicenseFragmentBase onNewInstance(LicenseFragmentBase fragment, ArrayList<Integer> licenseIDs) {
    Bundle bundle = new Bundle();
    bundle.putIntegerArrayList(ARG_LICENSE_IDS, licenseIDs);
    fragment.setArguments(bundle);
    return fragment;
}
 
Example 20
Source Project: LabelsView   File: LabelsView.java    License: Apache License 2.0 4 votes vote down vote up
@Override
    protected Parcelable onSaveInstanceState() {

        Bundle bundle = new Bundle();
        //保存父类的信息
        bundle.putParcelable(KEY_SUPER_STATE, super.onSaveInstanceState());
        //保存标签文字颜色
        if (mTextColor != null) {
            bundle.putParcelable(KEY_TEXT_COLOR_STATE, mTextColor);
        }
        //保存标签文字大小
        bundle.putFloat(KEY_TEXT_SIZE_STATE, mTextSize);
        //保存标签背景 (由于背景改用Drawable,所以不能自动保存和恢复)
//        bundle.putInt(KEY_BG_RES_ID_STATE, mLabelBgResId);
        //保存标签宽高
        bundle.putInt(KEY_LABEL_WIDTH_STATE, mLabelWidth);
        bundle.putInt(KEY_LABEL_HEIGHT_STATE, mLabelHeight);
        //保存标签方向
        bundle.putInt(KEY_LABEL_GRAVITY_STATE, mLabelGravity);
        //保存标签内边距
        bundle.putIntArray(KEY_PADDING_STATE, new int[]{mTextPaddingLeft, mTextPaddingTop,
                mTextPaddingRight, mTextPaddingBottom});
        //保存标签间隔
        bundle.putInt(KEY_WORD_MARGIN_STATE, mWordMargin);
        //保存行间隔
        bundle.putInt(KEY_LINE_MARGIN_STATE, mLineMargin);
        //保存标签的选择类型
        bundle.putInt(KEY_SELECT_TYPE_STATE, mSelectType.value);
        //保存标签的最大选择数量
        bundle.putInt(KEY_MAX_SELECT_STATE, mMaxSelect);
        //保存标签的最少选择数量
        bundle.putInt(KEY_MIN_SELECT_STATE, mMinSelect);
        //保存标签的最大行数
        bundle.putInt(KEY_MAX_LINES_STATE, mMaxLines);
        //保存是否是指示器模式
        bundle.putBoolean(KEY_INDICATOR_STATE, isIndicator);

        //保存标签列表
//        if (!mLabels.isEmpty()) {
//            bundle.putStringArrayList(KEY_LABELS_STATE, mLabels);
//        }
        //保存已选择的标签列表
        if (!mSelectLabels.isEmpty()) {
            bundle.putIntegerArrayList(KEY_SELECT_LABELS_STATE, mSelectLabels);
        }

        //保存必选项列表
        if (!mCompulsorys.isEmpty()) {
            bundle.putIntegerArrayList(KEY_COMPULSORY_LABELS_STATE, mCompulsorys);
        }

        bundle.putBoolean(KEY_SINGLE_LINE_STATE, isSingleLine);

        return bundle;
    }