本文整理汇总了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;
}
示例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);
}
});
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}
}