當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。