本文整理汇总了Java中android.os.Bundle.getStringArray方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.getStringArray方法的具体用法?Java Bundle.getStringArray怎么用?Java Bundle.getStringArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.getStringArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mTitleResId = getArguments().getInt(KEY_TITLE_ID);
mColumns = getArguments().getInt(KEY_COLUMNS);
mSize = getArguments().getInt(KEY_SIZE);
}
if (savedInstanceState != null) {
mColors = savedInstanceState.getIntArray(KEY_COLORS);
mSelectedColor = (Integer) savedInstanceState.getSerializable(KEY_SELECTED_COLOR);
mColorContentDescriptions = savedInstanceState.getStringArray(
KEY_COLOR_CONTENT_DESCRIPTIONS);
}
}
示例2: show
import android.os.Bundle; //导入方法依赖的package包/类
private static void show(FragmentManager fm, int requestCode, String title, CharSequence csPositive, CharSequence csNagative, String[] items, boolean hasDefaultSelect, boolean[] selectedIndexes){
MultiChoiceFragment dialog = new MultiChoiceFragment();
Bundle args = new Bundle();
args.putString(ARG_TITLE, title);
args.putStringArray(ARG_ITEMS, items);
if (!hasDefaultSelect){
boolean[] bs = new boolean[args.getStringArray(ARG_ITEMS).length];
for(int i=0; i<bs.length; i++){
bs[i] = false;
}
args.putBooleanArray(ARG_SELECTED_INDEXES, bs);
}else{
args.putBooleanArray(ARG_SELECTED_INDEXES, selectedIndexes);
}
args.putInt(ARG_REQUEST_CODE, requestCode);
args.putCharSequence(ARG_POSITIVE_TEXT, csPositive);
args.putCharSequence(ARG_NAGATIVE_TEXT, csNagative);
dialog.setArguments(args);
dialog.setCancelable(false);
dialog.show(fm, TAG);
}
示例3: initBundle
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected boolean initBundle(Bundle bundle) {
if (bundle != null) {
final String[] ids = bundle.getStringArray(TweetPublishService.EXTRA_IDS);
if (ids != null && ids.length > 0) {
AppOperator.runOnThread(new Runnable() {
@Override
public void run() {
Context context = getApplicationContext();
List<TweetPublishModel> models = new ArrayList<>();
for (String str : ids) {
TweetPublishModel model = TweetPublishCache.get(context, str);
if (model != null)
models.add(model);
}
if (models.size() > 0)
addData(models);
else
finish();
}
});
return true;
}
}
return false;
}
示例4: onCreate
import android.os.Bundle; //导入方法依赖的package包/类
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
paths = new ArrayList<>();
Bundle bundle = getArguments();
if (bundle != null) {
String[] pathArr = bundle.getStringArray(ARG_PATH);
paths.clear();
if (pathArr != null) {
paths = new ArrayList<>(Arrays.asList(pathArr));
}
hasAnim = bundle.getBoolean(ARG_HAS_ANIM);
currentItem = bundle.getInt(ARG_CURRENT_ITEM);
thumbnailTop = bundle.getInt(ARG_THUMBNAIL_TOP);
thumbnailLeft = bundle.getInt(ARG_THUMBNAIL_LEFT);
thumbnailWidth = bundle.getInt(ARG_THUMBNAIL_WIDTH);
thumbnailHeight = bundle.getInt(ARG_THUMBNAIL_HEIGHT);
}
mPagerAdapter = new PhotoPagerAdapter(Glide.with(this), paths);
}
示例5: onAttach
import android.os.Bundle; //导入方法依赖的package包/类
public void onAttach(Activity activity) {
super.onAttach(activity);
Bundle args = getArguments();
if (args != null) {
this.CHARTLET_RES_IDS = args.getIntArray(KEY_DRAWABLE_IDS);
this.mThumbailIds = args.getIntArray(KEY_THUMBNAIL_DRAWABLE_IDS);
this.CHARTLET_TEXTS = args.getStringArray(KEY_STRINGS);
this.mUri = Uri.parse(args.getString(KEY_URI_STR));
}
}
示例6: getUnreadConversationFromBundle
import android.os.Bundle; //导入方法依赖的package包/类
static UnreadConversation getUnreadConversationFromBundle(Bundle b, Factory factory, RemoteInput.Factory remoteInputFactory) {
RemoteInput remoteInput = null;
if (b == null) {
return null;
}
Parcelable[] parcelableMessages = b.getParcelableArray(KEY_MESSAGES);
String[] messages = null;
if (parcelableMessages != null) {
String[] tmp = new String[parcelableMessages.length];
boolean success = true;
for (int i = 0; i < tmp.length; i++) {
if (!(parcelableMessages[i] instanceof Bundle)) {
success = false;
break;
}
tmp[i] = ((Bundle) parcelableMessages[i]).getString("text");
if (tmp[i] == null) {
success = false;
break;
}
}
if (!success) {
return null;
}
messages = tmp;
}
PendingIntent onRead = (PendingIntent) b.getParcelable(KEY_ON_READ);
PendingIntent onReply = (PendingIntent) b.getParcelable(KEY_ON_REPLY);
android.app.RemoteInput remoteInput2 = (android.app.RemoteInput) b.getParcelable(KEY_REMOTE_INPUT);
String[] participants = b.getStringArray(KEY_PARTICIPANTS);
if (participants == null || participants.length != 1) {
return null;
}
if (remoteInput2 != null) {
remoteInput = toCompatRemoteInput(remoteInput2, remoteInputFactory);
}
return factory.build(messages, remoteInput, onReply, onRead, participants, b.getLong(KEY_TIMESTAMP));
}
示例7: onCreate
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle b=this.getIntent().getExtras();
String[] permissions = b.getStringArray(Constants.APP_PREMISSION_KEY);
requestPermissions(permissions);
}
示例8: setArguments
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void setArguments(Bundle args) {
super.setArguments(args);
mImportantDomains = args.getStringArray(IMPORTANT_DOMAINS_TAG);
mFaviconURLs = args.getStringArray(FAVICON_URLS_TAG);
int[] importantDomainReasons = args.getIntArray(IMPORTANT_DOMAIN_REASONS_TAG);
for (int i = 0; i < mImportantDomains.length; ++i) {
mImportantDomainsReasons.put(mImportantDomains[i], importantDomainReasons[i]);
mCheckedState.put(mImportantDomains[i], true);
}
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:12,代码来源:ConfirmImportantSitesDialogFragment.java
示例9: onResume
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
// Only do request when there is no pending request to avoid duplicated requests.
if (mPendingRequestCode == INVALID_REQUEST_CODE) {
final Bundle extras = getIntent().getExtras();
final String[] permissionsToRequest =
extras.getStringArray(EXTRA_PERMISSION_REQUESTED_PERMISSIONS);
mPendingRequestCode = extras.getInt(EXTRA_PERMISSION_REQUEST_CODE);
// Assuming that all supplied permissions are not granted yet, so that we don't need to
// check them again.
PermissionsUtil.requestPermissions(this, mPendingRequestCode, permissionsToRequest);
}
}
示例10: onCreate
import android.os.Bundle; //导入方法依赖的package包/类
protected void onCreate(@Nullable Bundle savedInstanceState) {
List list = null;
this.mFragments.attachHost(null);
super.onCreate(savedInstanceState);
NonConfigurationInstances nc = (NonConfigurationInstances) getLastNonConfigurationInstance();
if (nc != null) {
this.mFragments.restoreLoaderNonConfig(nc.loaders);
}
if (savedInstanceState != null) {
Parcelable p = savedInstanceState.getParcelable(FRAGMENTS_TAG);
FragmentController fragmentController = this.mFragments;
if (nc != null) {
list = nc.fragments;
}
fragmentController.restoreAllState(p, list);
if (savedInstanceState.containsKey(NEXT_CANDIDATE_REQUEST_INDEX_TAG)) {
this.mNextCandidateRequestIndex = savedInstanceState.getInt(NEXT_CANDIDATE_REQUEST_INDEX_TAG);
int[] requestCodes = savedInstanceState.getIntArray(ALLOCATED_REQUEST_INDICIES_TAG);
String[] fragmentWhos = savedInstanceState.getStringArray(REQUEST_FRAGMENT_WHO_TAG);
if (requestCodes == null || fragmentWhos == null || requestCodes.length != fragmentWhos.length) {
Log.w(TAG, "Invalid requestCode mapping in savedInstanceState.");
} else {
this.mPendingFragmentActivityResults = new SparseArrayCompat(requestCodes.length);
for (int i = 0; i < requestCodes.length; i++) {
this.mPendingFragmentActivityResults.put(requestCodes[i], fragmentWhos[i]);
}
}
}
}
if (this.mPendingFragmentActivityResults == null) {
this.mPendingFragmentActivityResults = new SparseArrayCompat();
this.mNextCandidateRequestIndex = 0;
}
this.mFragments.dispatchCreate();
}
示例11: RationaleDialogConfig
import android.os.Bundle; //导入方法依赖的package包/类
RationaleDialogConfig(Bundle bundle) {
positiveButton = bundle.getInt(KEY_POSITIVE_BUTTON);
negativeButton = bundle.getInt(KEY_NEGATIVE_BUTTON);
rationaleMsg = bundle.getString(KEY_RATIONALE_MESSAGE);
requestCode = bundle.getInt(KEY_REQUEST_CODE);
permissions = bundle.getStringArray(KEY_PERMISSIONS);
}
示例12: onCreate
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Bundle args = getArguments();
mCategories = args.getStringArray(KEY_CATEGORIES);
mCheckedCategories = new SparseBooleanArray();
}
示例13: initBundle
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected boolean initBundle(Bundle bundle) {
mImageSources = bundle.getStringArray(KEY_IMAGE);
mCurPosition = bundle.getInt(KEY_POSITION, 0);
mNeedSaveLocal = bundle.getBoolean(KEY_NEED_SAVE, true);
mNeedCookie = bundle.getBoolean(KEY_COOKIE, false);
if (mImageSources != null) {
// 初始化下载状态
mImageDownloadStatus = new boolean[mImageSources.length];
return true;
}
return false;
}
示例14: onActivityCreated
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (savedInstanceState != null) {
mProductsId = savedInstanceState.getStringArray(Extras.EXTRA_PRODUCT_ID);
}
mAsyncTask = new InAppProductsLoader().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
示例15: onCreate
import android.os.Bundle; //导入方法依赖的package包/类
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.webdatauploadlist);
Bundle extras = getIntent().getExtras();
user = extras.getString(PREFS_KEY_USER);
pwd = extras.getString(PREFS_KEY_PWD);
url = extras.getString(PREFS_KEY_URL);
databases = extras.getStringArray(DATABASE_ID);
refreshList();
}