当前位置: 首页>>代码示例>>Java>>正文


Java Bundle.putStringArrayList方法代码示例

本文整理汇总了Java中android.os.Bundle.putStringArrayList方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.putStringArrayList方法的具体用法?Java Bundle.putStringArrayList怎么用?Java Bundle.putStringArrayList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.putStringArrayList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onResult

import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected Bundle onResult(int which) {
    Bundle result = super.onResult(which);
    if (result != null) {

        ArrayList<Integer> positions = result.getIntegerArrayList(SELECTED_POSITIONS);
        if (positions != null) {
            ArrayList<String> labels = new ArrayList<>(positions.size());
            for (Integer pos : positions) {
                labels.add(mData.get(pos).getString());
            }
            result.putStringArrayList(SELECTED_LABELS, labels);
        }

        if (result.containsKey(SELECTED_SINGLE_POSITION)) {
            result.putString(SELECTED_SINGLE_LABEL, mData.get(
                    result.getInt(SELECTED_SINGLE_POSITION)).getString());
        }

    }
    return result;
}
 
开发者ID:eltos,项目名称:SimpleDialogFragments,代码行数:23,代码来源:SimpleListDialog.java

示例2: process

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Process the extracted text as identified as a command
 *
 * @param text the command to process
 */
private void process(@NonNull final String text) {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "process");
    }

    final Bundle bundle = new Bundle();

    final ArrayList<String> voiceResults = new ArrayList<>(1);
    voiceResults.add(text);

    final float[] confidence = new float[1];
    confidence[0] = 1f;

    bundle.putStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION, voiceResults);
    bundle.putFloatArray(SpeechRecognizer.CONFIDENCE_SCORES, confidence);
    bundle.putInt(LocalRequest.EXTRA_CONDITION, Condition.CONDITION_GOOGLE_NOW);

    AsyncTask.execute(new Runnable() {
        @Override
        public void run() {
            new RecognitionAction(SaiyAccessibilityService.this.getApplicationContext(), SPH.getVRLocale(SaiyAccessibilityService.this.getApplicationContext()),
                    SPH.getTTSLocale(SaiyAccessibilityService.this.getApplicationContext()), sl, bundle);
        }
    });
}
 
开发者ID:brandall76,项目名称:Saiy-PS,代码行数:31,代码来源:SaiyAccessibilityService.java

示例3: createBaseParameters

import android.os.Bundle; //导入方法依赖的package包/类
private static Bundle createBaseParameters(ShareContent content, boolean dataErrorsFatal) {
    Bundle params = new Bundle();

    Utility.putUri(params, ShareConstants.CONTENT_URL, content.getContentUrl());
    Utility.putNonEmptyString(params, ShareConstants.PLACE_ID, content.getPlaceId());
    Utility.putNonEmptyString(params, ShareConstants.REF, content.getRef());

    params.putBoolean(ShareConstants.DATA_FAILURES_FATAL, dataErrorsFatal);

    List<String> peopleIds = content.getPeopleIds();
    if (!Utility.isNullOrEmpty(peopleIds)) {
        params.putStringArrayList(
                ShareConstants.PEOPLE_IDS,
                new ArrayList<String>(peopleIds));
    }

    return params;
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:19,代码来源:NativeDialogParameters.java

示例4: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    if (mSelectedContextAccount != null) {
        outState.putString(SELECTED_CONTEXT_ACCOUNT, mSelectedContextAccount.getUuid());
    }
    outState.putSerializable(STATE_UNREAD_COUNT, mUnreadMessageCount);
    outState.putSerializable(ACCOUNT_STATS, accountStats);

    outState.putBoolean(STATE_EXPORT_GLOBAL_SETTINGS, exportGlobalSettings);
    outState.putStringArrayList(STATE_EXPORT_ACCOUNTS, exportAccountUuids);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:13,代码来源:Accounts.java

示例5: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putParcelable("instanceState", super.onSaveInstanceState());
    bundle.putInt("TICK_COUNT", mTickCount);
    bundle.putInt("TICK_COLOR", mTickColor);
    bundle.putFloat("TICK_HEIGHT_DP", mTickHeightDP);
    bundle.putFloat("BAR_WEIGHT", mBarWeight);
    bundle.putInt("BAR_COLOR", mBarColor);
    bundle.putFloat("CIRCLE_SIZE", mCircleSize);
    bundle.putInt("CIRCLE_COLOR", mCircleColor);
    bundle.putInt("CIRCLE_BOUNDARY_COLOR", mCircleBoundaryColor);
    bundle.putFloat("CIRCLE_BOUNDARY_WIDTH", mCircleBoundarySize);
    bundle.putFloat("THUMB_RADIUS_DP", mThumbRadiusDP);
    bundle.putFloat("EXPANDED_PIN_RADIUS_DP", mExpandedPinRadius);
    bundle.putFloat("PIN_PADDING", mPinPadding);
    bundle.putFloat("BAR_PADDING_BOTTOM", mBarPaddingBottom);
    bundle.putInt("RIGHT_INDEX", mRightIndex);
    bundle.putFloat("MARGIN", mMargin);
    bundle.putInt("TICK_BOUNDARY_COLOR", mTickBoundaryColor);
    bundle.putFloat("TICK_BOUNDARY_WIDTH", mTickBoundaryWidth);
    bundle.putInt("EFFECT_COLOR", mEffectColor);
    bundle.putInt("CHOOSE_TEXT_COLOR", mChooseTextColor);
    bundle.putInt("UNCHOOSE_TEXT_COLOR", mUnChooseTextColor);
    bundle.putFloat("BAR_TEXT_SIZE", mBarTextSize);
    bundle.putFloat("BAR_TEXT_MARGIN_RANGE_BAR", mBarTextMarginRangeBar);
    bundle.putStringArrayList("LIST", mList);
    return bundle;
}
 
开发者ID:hidetag,项目名称:DistanceRangeBar,代码行数:30,代码来源:DistanceRangeBar.java

示例6: launchActivity

import android.os.Bundle; //导入方法依赖的package包/类
public static void launchActivity(Activity context, int position, ArrayList<String> imgList){
    Bundle bundle = new Bundle();
    bundle.putInt("position",position);
    bundle.putStringArrayList("imgList", imgList);
    Intent intent = new Intent(context, WelfareDetailActivity.class);
    intent.putExtras(bundle);
    context.startActivity(intent);
    context.overridePendingTransition(R.anim.fade_entry, R.anim.hold);
}
 
开发者ID:lai233333,项目名称:MyDemo,代码行数:10,代码来源:WelfareDetailActivity.java

示例7: json2Bundle

import android.os.Bundle; //导入方法依赖的package包/类
private Bundle json2Bundle(String json) {
    if (TextUtils.isEmpty(json)) {
        return null;
    }
    Bundle bundle = new Bundle();
    JSONObject jo = JSON.parseObject(json);

    Iterator<Map.Entry<String,Object>> iterator = jo.entrySet().iterator();
    Map.Entry<String,Object> entry;
    Object value;
    while (iterator.hasNext()){
        entry = iterator.next();
        value = entry.getValue();
        if (value != null) {
            if (value instanceof JSONArray) {
                JSONArray array = (JSONArray) value;
                ArrayList<String> strList = new ArrayList<String>(array.size());
                for (Object item : array) {
                    if (item != null) {
                        strList.add(String.valueOf(item));
                    }
                }
                bundle.putStringArrayList(entry.getKey(), strList);
            } else if (value instanceof Serializable) {
                bundle.putSerializable(entry.getKey(), (Serializable) value);
            } else if (value instanceof Parcelable) {
                bundle.putParcelable(entry.getKey(), (Parcelable) value);
            } else {
                bundle.putString(entry.getKey(), value.toString());
            }
        }

    }
    return bundle;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:36,代码来源:JsonHelperImpl.java

示例8: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState) {
    Log.d(TAG, "onSaveInstanceState: Save dialog state");
    super.onSaveInstanceState(outState);

    outState.putInt(KEY_SHOWING_DIALOG_COUNT, showingDialogCount);

    outState.putParcelableArrayList(KEY_DIALOG_MESSAGES,
            (ArrayList<? extends Parcelable>) dialogMessages);

    outState.putStringArrayList(KEY_REQUEST_QUEUE, (ArrayList<String>) requestQueue);

    outState.putInt(KEY_REQUEST_CODE, requestCode);
}
 
开发者ID:farukydnn,项目名称:WeatherPlus,代码行数:15,代码来源:PermissionActivity.java

示例9: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    DebugLog.logMethod();
    if (coupons != null) {
        DebugLog.logMessage("Coupons: " + coupons.size());
        outState.putParcelableArrayList(Constants.BUNDLE_EXTRA_COUPONS, coupons);
    }
    outState.putInt(
            Constants.BUNDLE_EXTRA_LIST_POSITION,
            ((LinearLayoutManager) recyclerView.getLayoutManager()).findFirstCompletelyVisibleItemPosition()
    );
    outState.putStringArrayList(Constants.BUNDLE_EXTRA_MERCHANT_SUGGESTIONS, merchants);
    outState.putStringArrayList(Constants.BUNDLE_EXTRA_CATEGORY_SUGGESTIONS, categories);
}
 
开发者ID:darsh2,项目名称:CouponsTracker,代码行数:16,代码来源:CouponListFragment.java

示例10: saveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
public void saveInstanceState(Bundle outState) {
    boolean active = isSelectorModeActive();
    outState.putString(SELECTOR_MODE_ACTIVE, String.valueOf(active));
    if (active) {
        outState.putStringArrayList(SELECTED_ITEMS_PATHS, selected_items_paths);
    }
}
 
开发者ID:kollerlukas,项目名称:Camera-Roll-Android-App,代码行数:8,代码来源:SelectorModeManager.java

示例11: create

import android.os.Bundle; //导入方法依赖的package包/类
private static Bundle create(
        SharePhotoContent photoContent,
        List<String> imageUrls,
        boolean dataErrorsFatal) {
    Bundle params = createBaseParameters(photoContent, dataErrorsFatal);

    params.putStringArrayList(ShareConstants.PHOTOS, new ArrayList<>(imageUrls));

    return params;
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:11,代码来源:NativeDialogParameters.java

示例12: shareToQZone

import android.os.Bundle; //导入方法依赖的package包/类
public static void shareToQZone(Context context, String appId, String title, String summary, String url,
                                String imageUrl, IUiListener listener) {
    Bundle params = new Bundle();
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
    params.putString(QzoneShare.SHARE_TO_QQ_TITLE, title);
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, summary);
    params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, url);
    ArrayList<String> imgs = new ArrayList<String>();
    imgs.add(imageUrl);
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, imgs);
    Tencent tencent = getInstance(context, appId);
    tencent.shareToQzone((Activity) context, params, listener);
}
 
开发者ID:yangjie127,项目名称:ESSocialSDK-master,代码行数:14,代码来源:QQShareProxy.java

示例13: setUpPlayer

import android.os.Bundle; //导入方法依赖的package包/类
private void setUpPlayer() {
  FragmentManager fragmentManager = getSupportFragmentManager();
  FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
  ExVpCompleteFragment exVpCompleteFragment = new ExVpCompleteFragment();
  Bundle bundle = new Bundle();
  bundle.putStringArrayList("urls", video_url);
  bundle.putStringArrayList("type", video_type);
  bundle.putInt("currentIndex", currentIndex);
  exVpCompleteFragment.setArguments(bundle);
  fragmentTransaction.add(R.id.parent, exVpCompleteFragment);
  fragmentTransaction.commit();
}
 
开发者ID:karanvs,项目名称:ExVidPlayer,代码行数:13,代码来源:ExVidPlayerActivity.java

示例14: checkPermissions

import android.os.Bundle; //导入方法依赖的package包/类
private boolean checkPermissions() {
    ArrayList<String> missingPermissions = new ArrayList<String>();
    int permissionCheck = ContextCompat.checkSelfPermission(getContext(), Manifest.permission.WRITE_CALENDAR);
    if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
        missingPermissions.add(Manifest.permission.READ_CALENDAR);
        missingPermissions.add(Manifest.permission.WRITE_CALENDAR);
    }
    permissionCheck = ContextCompat.checkSelfPermission(getContext(), Manifest.permission.WRITE_SYNC_SETTINGS);
    if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
        missingPermissions.add(Manifest.permission.ACCOUNT_MANAGER);
        missingPermissions.add(Manifest.permission.READ_SYNC_SETTINGS);
        missingPermissions.add(Manifest.permission.WRITE_SYNC_SETTINGS);
    }

    logger.info("SYNC.PERM", "Missing permissions: " + missingPermissions.toString());

    if (!missingPermissions.isEmpty()) {
        Bundle extras = new Bundle();
        extras.putStringArrayList(PermissionRequestActivity.MISSING_PERMISSIONS, missingPermissions);

        Intent intent = new Intent(getContext(), PermissionRequestActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtras(extras);
        getContext().startActivity(intent);
        return false;
    }
    return true;
}
 
开发者ID:danvratil,项目名称:FBEventSync,代码行数:29,代码来源:CalendarSyncAdapter.java

示例15: saveElements

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void saveElements(Pager.Page page, ElementSource source, List<Object> elements, Bundle state) {
    ArrayList<String> list = new ArrayList<>();
    for (Object element : elements) {
        if (element instanceof String) {
            list.add((String) element);
        }
    }
    if (!list.isEmpty()) {
        state.putStringArrayList("page:"+page.getPageNumber(), list);
    }
}
 
开发者ID:natario1,项目名称:Elements,代码行数:13,代码来源:StringSerializer.java


注:本文中的android.os.Bundle.putStringArrayList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。