本文整理汇总了Java中android.os.Bundle.getIntArray方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.getIntArray方法的具体用法?Java Bundle.getIntArray怎么用?Java Bundle.getIntArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.getIntArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public final void restoreInstanceState(@Nullable final Bundle savedInstanceState) {
if (savedInstanceState != null) {
firstVisibleTabIndex = savedInstanceState.getInt(FIRST_VISIBLE_TAB_INDEX_EXTRA, -1);
firstVisibleTabPosition =
savedInstanceState.getFloat(FIRST_VISIBLE_TAB_POSITION_EXTRA, -1);
logLevel = (LogLevel) savedInstanceState.getSerializable(LOG_LEVEL_EXTRA);
tabs = savedInstanceState.getParcelableArrayList(TABS_EXTRA);
switcherShown = savedInstanceState.getBoolean(SWITCHER_SHOWN_EXTRA);
selectedTab = savedInstanceState.getParcelable(SELECTED_TAB_EXTRA);
padding = savedInstanceState.getIntArray(PADDING_EXTRA);
tabIconId = savedInstanceState.getInt(TAB_ICON_ID_EXTRA);
tabIconBitmap = savedInstanceState.getParcelable(TAB_ICON_BITMAP_EXTRA);
tabBackgroundColor = savedInstanceState.getParcelable(TAB_BACKGROUND_COLOR_EXTRA);
tabTitleTextColor = savedInstanceState.getParcelable(TAB_TITLE_TEXT_COLOR_EXTRA);
tabCloseButtonIconId = savedInstanceState.getInt(TAB_CLOSE_BUTTON_ICON_ID_EXTRA);
tabCloseButtonIconBitmap =
savedInstanceState.getParcelable(TAB_CLOSE_BUTTON_ICON_BITMAP_EXTRA);
showToolbars = savedInstanceState.getBoolean(SHOW_TOOLBARS_EXTRA);
toolbarTitle = savedInstanceState.getCharSequence(TOOLBAR_TITLE_EXTRA);
childRecyclerAdapter.restoreInstanceState(savedInstanceState);
}
}
示例2: 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);
}
}
示例3: onRestoreInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
public void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
Bundle bundle = (Bundle) state;
this.mDataChanged = true;
this.mSyncHeight = (long) bundle.getInt("height");
long firstId = bundle.getLong("firstId");
if (firstId >= 0) {
this.mNeedSync = true;
SavedState ss = new SavedState();
ss.firstId = firstId;
ss.height = (int) this.mSyncHeight;
ss.position = bundle.getInt(FriendShipActivity.FRIENDSHIP_POSITION);
ss.viewTop = bundle.getInt("viewTop");
ss.childCount = bundle.getInt("childCount");
ss.viewTops = bundle.getIntArray("viewTops");
this.mPendingSync = ss;
this.mSyncRowId = ss.firstId;
this.mSyncPosition = ss.position;
this.mSpecificTop = ss.viewTop;
this.mSpecificTops = ss.viewTops;
}
state = bundle.getParcelable("instanceState");
}
super.onRestoreInstanceState(state);
requestLayout();
}
示例4: onCreate
import android.os.Bundle; //导入方法依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
this.CHARTLET_RES_IDS = savedInstanceState.getIntArray(KEY_DRAWABLE_IDS);
this.mThumbailIds = savedInstanceState.getIntArray(KEY_THUMBNAIL_DRAWABLE_IDS);
this.CHARTLET_TEXTS = savedInstanceState.getStringArray(KEY_STRINGS);
this.mUri = Uri.parse(savedInstanceState.getString(KEY_URI_STR));
}
}
示例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: onReceiveResult
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onReceiveResult(int resultCode, Bundle resultData) {
if (resultCode == ModDisplay.RESULT_AUTOBRIGHTNESS_CONFIG) {
mLuxArray = resultData.getIntArray("config_autoBrightnessLevels");
mBrightnessArray = resultData.getIntArray("config_autoBrightnessLcdBacklightValues");
saveConfig();
setData();
}
}
示例7: restoreManagedDialogs
import android.os.Bundle; //导入方法依赖的package包/类
/**
* Restore the state of any saved managed dialogs.
*
* @param savedInstanceState The bundle to restore from.
*/
private void restoreManagedDialogs(Bundle savedInstanceState) {
final Bundle b = savedInstanceState.getBundle(SAVED_DIALOGS_TAG);
if (b == null) {
return;
}
final int[] ids = b.getIntArray(SAVED_DIALOG_IDS_KEY);
final int numDialogs = ids.length;
mManagedDialogs = new SparseArray<ManagedDialog>(numDialogs);
for (int i = 0; i < numDialogs; i++) {
final Integer dialogId = ids[i];
Bundle dialogState = b.getBundle(savedDialogKeyFor(dialogId));
if (dialogState != null) {
// Calling onRestoreInstanceState() below will invoke dispatchOnCreate
// so tell createDialog() not to do it, otherwise we get an exception
final ManagedDialog md = new ManagedDialog();
md.mArgs = b.getBundle(savedDialogArgsKeyFor(dialogId));
md.mDialog = createDialog(dialogId, dialogState, md.mArgs);
if (md.mDialog != null) {
mManagedDialogs.put(dialogId, md);
onPrepareDialog(dialogId, md.mDialog, md.mArgs);
md.mDialog.onRestoreInstanceState(dialogState);
}
}
}
}
示例8: 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();
}
示例9: safeGetIntArray
import android.os.Bundle; //导入方法依赖的package包/类
/**
* Just like {@link Bundle#getIntArray(String)} but doesn't throw exceptions.
*/
public static int[] safeGetIntArray(Bundle bundle, String name) {
try {
return bundle.getIntArray(name);
} catch (Throwable t) {
// Catches un-parceling exceptions.
Log.e(TAG, "getIntArray failed on bundle " + bundle);
return null;
}
}
示例10: 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
示例11: init
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void init(Bundle savedInstanceState) {
imageView = (ImageView) findViewById(R.id.fst_iv);
Bundle args = savedInstanceState == null ? getArguments() : savedInstanceState;
mType = args.getInt(BUNDLE_KEY);
int iconId = 0;
switch (mType) {
case TYPE_HAMMER:
iconId = R.drawable.hammer_h;
break;
case TYPE_HOURGLASS:
iconId = R.drawable.hourglass_h;
break;
case TYPE_CLOUD:
iconId = R.drawable.cloud_h;
break;
case TYPE_SEND:
iconId = R.drawable.send_h;
break;
}
//start transaction anim.
preLocation = args.getIntArray(BUNDLE_KEY + 1);
preSize = args.getIntArray(BUNDLE_KEY + 2);
mStartValues = new Bundle();
mStartValues.putInt(PROPNAME_WIDTH, preSize[0]);
mStartValues.putInt(PROPNAME_HEIGHT, preSize[1]);
mStartValues.putInt(PROPNAME_SCREENLOCATION_LEFT, preLocation[0]);
mStartValues.putInt(PROPNAME_SCREENLOCATION_TOP, preLocation[1]);
Picasso.with(mContext).load(iconId).into(imageView, new Callback() {
@Override
public void onSuccess() {
onUiReady();
}
@Override
public void onError() {
}
});
}
示例12: getIntArray
import android.os.Bundle; //导入方法依赖的package包/类
public int[] getIntArray(Bundle state, String key) {
return state.getIntArray(key + baseKey);
}
示例13: onRestoreInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onRestoreInstanceState(Bundle bundle) {
super.onRestoreInstanceState(bundle);
mLazySpanLookup.mData = bundle.getIntArray(LOOKUP_BUNDLE_KEY);
}
示例14: getIntArray
import android.os.Bundle; //导入方法依赖的package包/类
public int[] getIntArray(Bundle state, String key) {
return state.getIntArray(key + mBaseKey);
}
示例15: onRestoreInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onRestoreInstanceState(Parcelable state) {
if (!(state instanceof Bundle)) {
// Not supposed to happen.
super.onRestoreInstanceState(state);
return;
}
Bundle b = (Bundle) state;
Parcelable superState = b.getParcelable("gv_super_state");
setEnabled(b.getBoolean("gv_en", true));
int[] data = b.getIntArray("gv_data");
if (data != null && data.length == mData.length) {
for (int i = 0; i < data.length; i++) {
mData[i] = State.fromInt(data[i]);
}
}
mSelectedCell = b.getInt("gv_sel_cell", -1);
mSelectedValue = State.fromInt(b.getInt("gv_sel_val", State.EMPTY.getValue()));
mCurrentPlayer = State.fromInt(b.getInt("gv_curr_play", State.EMPTY.getValue()));
mWinner = State.fromInt(b.getInt("gv_winner", State.EMPTY.getValue()));
mWinCol = b.getInt("gv_win_col", -1);
mWinRow = b.getInt("gv_win_row", -1);
mWinDiag = b.getInt("gv_win_diag", -1);
mBlinkDisplayOff = b.getBoolean("gv_blink_off", false);
Rect r = b.getParcelable("gv_blink_rect");
if (r != null) {
mBlinkRect.set(r);
}
// let the blink handler decide if it should blink or not
mHandler.sendEmptyMessage(MSG_BLINK);
super.onRestoreInstanceState(superState);
}