本文整理汇总了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;
}
示例2: putCharSequenceArray
import android.os.Bundle; //导入方法依赖的package包/类
public void putCharSequenceArray(Bundle state, String key, CharSequence[] x) {
state.putCharSequenceArray(key + baseKey, x);
}
示例3: putCharSequenceArray
import android.os.Bundle; //导入方法依赖的package包/类
public void putCharSequenceArray(Bundle state, String key, CharSequence[] x) {
state.putCharSequenceArray(key + mBaseKey, x);
}
示例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);
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}