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


Java Bundle.putCharSequenceArray方法代码示例

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


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

示例1: toBundle

import android.os.Bundle; //导入方法依赖的package包/类
static Bundle toBundle(RemoteInput remoteInput) {
    Bundle data = new Bundle();
    data.putString(KEY_RESULT_KEY, remoteInput.getResultKey());
    data.putCharSequence(KEY_LABEL, remoteInput.getLabel());
    data.putCharSequenceArray(KEY_CHOICES, remoteInput.getChoices());
    data.putBoolean(KEY_ALLOW_FREE_FORM_INPUT, remoteInput.getAllowFreeFormInput());
    data.putBundle(KEY_EXTRAS, remoteInput.getExtras());
    return data;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:RemoteInputCompatJellybean.java

示例2: putCharSequenceArray

import android.os.Bundle; //导入方法依赖的package包/类
public void putCharSequenceArray(Bundle state, String key, CharSequence[] x) {
    state.putCharSequenceArray(key + baseKey, x);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:Injector.java

示例3: putCharSequenceArray

import android.os.Bundle; //导入方法依赖的package包/类
public void putCharSequenceArray(Bundle state, String key, CharSequence[] x) {
    state.putCharSequenceArray(key + mBaseKey, x);
}
 
开发者ID:evernote,项目名称:android-state,代码行数:4,代码来源:InjectionHelper.java

示例4: showAlert

import android.os.Bundle; //导入方法依赖的package包/类
@ReactMethod
public void showAlert(
    ReadableMap options,
    Callback errorCallback,
    Callback actionCallback) {
    System.out.println("Pilipa Alert Module showAlert");

  FragmentManagerHelper fragmentManagerHelper = getFragmentManagerHelper();
  if (fragmentManagerHelper == null) {
    errorCallback.invoke("Tried to show an alert while not attached to an Activity");
    return;
  }

  final Bundle args = new Bundle();
  if (options.hasKey(KEY_TITLE)) {
    args.putString(AlertFragment.ARG_TITLE, options.getString(KEY_TITLE));
  }
  if (options.hasKey(KEY_MESSAGE)) {
    args.putString(AlertFragment.ARG_MESSAGE, options.getString(KEY_MESSAGE));
  }
  if (options.hasKey(KEY_BUTTON_POSITIVE)) {
    args.putString(AlertFragment.ARG_BUTTON_POSITIVE, options.getString(KEY_BUTTON_POSITIVE));
  }
  if (options.hasKey(KEY_BUTTON_NEGATIVE)) {
    args.putString(AlertFragment.ARG_BUTTON_NEGATIVE, options.getString(KEY_BUTTON_NEGATIVE));
  }
  if (options.hasKey(KEY_BUTTON_NEUTRAL)) {
    args.putString(AlertFragment.ARG_BUTTON_NEUTRAL, options.getString(KEY_BUTTON_NEUTRAL));
  }
  if (options.hasKey(KEY_ITEMS)) {
    ReadableArray items = options.getArray(KEY_ITEMS);
    CharSequence[] itemsArray = new CharSequence[items.size()];
    for (int i = 0; i < items.size(); i ++) {
      itemsArray[i] = items.getString(i);
    }
    args.putCharSequenceArray(AlertFragment.ARG_ITEMS, itemsArray);
  }
  if (options.hasKey(KEY_CANCELABLE)) {
    args.putBoolean(KEY_CANCELABLE, options.getBoolean(KEY_CANCELABLE));
  }

  fragmentManagerHelper.showNewAlert(mIsInForeground, args, actionCallback);
}
 
开发者ID:pilipa-cn,项目名称:react-native-alert,代码行数:44,代码来源:DialogModule.java

示例5: GenerateUploadBundle

import android.os.Bundle; //导入方法依赖的package包/类
protected Bundle GenerateUploadBundle(String folderName, HashMap<String, Long> files, String serviceClassName){
    Bundle data = new Bundle();
    data.putString(UPLOAD_FOLDER, folderName);
    if (files != null) {
        UploadLogDBHelper dbHelper = new UploadLogDBHelper(getApplicationContext());
         Iterator<String> fileIT = files.keySet().iterator();
         int uploadNum = files.size();
         CharSequence[] fileNameArr = new CharSequence[uploadNum];
         boolean[] uploadTypeArr = new boolean[uploadNum];
         boolean[] isResendArr = new boolean[uploadNum];
         long[] sizeArr = new long[uploadNum];
         String fileName = "";
         long fileSize = 0L;
         int idx = 0;
         //boolean isForceUpload = false;
         FileInfo fileInfo = null;
         while(fileIT.hasNext()) {
             fileName = fileIT.next();
             fileSize = files.get(fileName);
             fileNameArr[idx] = fileName;
             sizeArr[idx] = fileSize;
             try{
                synchronized(mDBLock) {
                   fileInfo = dbHelper.getFileInfo(fileName);
                }
               Log.i(TAG, "GenerateUploadBundle: getFileInfo(" + fileName + ")= isForceUpload: " + fileInfo.isForceUpload + " isResend: " + fileInfo.isResend);
             } catch(Exception ex) {
                 Log.i(TAG, "GenerateUploadBundle: Exception Happen when isForceUploadFile(" + fileName + ") Msg: " + ex.toString());
                 fileInfo = new FileInfo();
             }
             uploadTypeArr[idx] = fileInfo.isForceUpload;
             isResendArr[idx] = fileInfo.isResend;
             idx ++;
         }
        if(dbHelper != null){
           dbHelper.close();
        }
        data.putCharSequenceArray(UPLOAD_FILE_NAMES, fileNameArr);
        data.putLongArray(UPLOAD_SIZES, sizeArr);
        data.putString(UPLOAD_AGENT_PACKAGE, this.getApplicationContext().getPackageName());
        data.putString(UPLOAD_AGENT, serviceClassName);
        data.putBooleanArray(UPLOAD_IS_FORCE_UPLOAD_TYPE, uploadTypeArr);
        data.putBooleanArray(UPLOAD_IS_RESEND_TYPE, isResendArr);
    }

    return data;
}
 
开发者ID:quanzhuo,项目名称:prada,代码行数:48,代码来源:UploadAgent.java

示例6: 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.putCharSequenceArray(field.getBundleKey(), (CharSequence[]) propertyField.get(to));
}
 
开发者ID:leobert-lan,项目名称:MagicBox,代码行数:7,代码来源:CharSequenceArrayWriter.java

示例7: showAlert

import android.os.Bundle; //导入方法依赖的package包/类
@ReactMethod
public void showAlert(
    ReadableMap options,
    Callback errorCallback,
    Callback actionCallback) {
  FragmentManagerHelper fragmentManagerHelper = getFragmentManagerHelper();
  if (fragmentManagerHelper == null) {
    errorCallback.invoke("Tried to show an alert while not attached to an Activity");
    return;
  }

  final Bundle args = new Bundle();
  if (options.hasKey(KEY_TITLE)) {
    args.putString(AlertFragment.ARG_TITLE, options.getString(KEY_TITLE));
  }
  if (options.hasKey(KEY_MESSAGE)) {
    args.putString(AlertFragment.ARG_MESSAGE, options.getString(KEY_MESSAGE));
  }
  if (options.hasKey(KEY_BUTTON_POSITIVE)) {
    args.putString(AlertFragment.ARG_BUTTON_POSITIVE, options.getString(KEY_BUTTON_POSITIVE));
  }
  if (options.hasKey(KEY_BUTTON_NEGATIVE)) {
    args.putString(AlertFragment.ARG_BUTTON_NEGATIVE, options.getString(KEY_BUTTON_NEGATIVE));
  }
  if (options.hasKey(KEY_BUTTON_NEUTRAL)) {
    args.putString(AlertFragment.ARG_BUTTON_NEUTRAL, options.getString(KEY_BUTTON_NEUTRAL));
  }
  if (options.hasKey(KEY_ITEMS)) {
    ReadableArray items = options.getArray(KEY_ITEMS);
    CharSequence[] itemsArray = new CharSequence[items.size()];
    for (int i = 0; i < items.size(); i ++) {
      itemsArray[i] = items.getString(i);
    }
    args.putCharSequenceArray(AlertFragment.ARG_ITEMS, itemsArray);
  }
  if (options.hasKey(KEY_CANCELABLE)) {
    args.putBoolean(KEY_CANCELABLE, options.getBoolean(KEY_CANCELABLE));
  }

  fragmentManagerHelper.showNewAlert(mIsInForeground, args, actionCallback);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:42,代码来源:DialogModule.java

示例8: serialize

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Write a field's value into the saved state {@link Bundle}.
 *
 * @param state      {@link Bundle} used to save the state
 * @param key        key retrieved from {@code fieldDeclaringClass#fieldName}
 * @param fieldValue value of field
 */
@Override
public void serialize(@NonNull Bundle state, @NonNull String key, @NonNull CharSequence[] fieldValue) {
    state.putCharSequenceArray(key, fieldValue);
}
 
开发者ID:Fondesa,项目名称:Lyra,代码行数:12,代码来源:CharSequenceArrayCoder.java


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