當前位置: 首頁>>代碼示例>>Java>>正文


Java Bundle.getStringArray方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:feliperce,項目名稱:MyNotes,代碼行數:18,代碼來源:ColorPickerDialog.java

示例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);
}
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:22,代碼來源:MultiChoiceFragment.java

示例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;
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:27,代碼來源:TweetPublishQueueActivity.java

示例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);
}
 
開發者ID:malijie,項目名稱:PhotoPicker-master,代碼行數:26,代碼來源:ImagePagerFragment.java

示例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));
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:11,代碼來源:ChartletFragment.java

示例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));
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:39,代碼來源:NotificationCompatApi21.java

示例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);
}
 
開發者ID:adityak368,項目名稱:Android-FileBrowser-FilePicker,代碼行數:8,代碼來源:Permissions.java

示例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);
    }
}
 
開發者ID:sergeychilingaryan,項目名稱:AOSP-Kayboard-7.1.2,代碼行數:15,代碼來源:PermissionsActivity.java

示例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();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:36,代碼來源:FragmentActivity.java

示例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);
}
 
開發者ID:42Chapters,項目名稱:AdaptationX-android,代碼行數:8,代碼來源:RationaleDialogConfig.java

示例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();
}
 
開發者ID:Applications-Development,項目名稱:SimpleRssReader,代碼行數:10,代碼來源:FilterByCategoriesFragment.java

示例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;
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:16,代碼來源:ImageGalleryActivity.java

示例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);
}
 
開發者ID:danimahardhika,項目名稱:wallpaperboard,代碼行數:10,代碼來源:InAppBillingFragment.java

示例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();
}
 
開發者ID:gvSIGAssociation,項目名稱:gvsig-mobile,代碼行數:13,代碼來源:SpatialiteExporterActivity.java


注:本文中的android.os.Bundle.getStringArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。