当前位置: 首页>>代码示例>>Java>>正文


Java Bundle.getIntArray方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:24,代码来源:TabSwitcherModel.java

示例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);
    }
}
 
开发者ID:feliperce,项目名称:MyNotes,代码行数:18,代码来源:ColorPickerDialog.java

示例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();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:27,代码来源:PLA_AbsListView.java

示例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));
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:ChartletFragment.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: 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();
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:10,代码来源:AutoBrightnessDialogPreference.java

示例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);
            }
        }
    }
}
 
开发者ID:JessYanCoding,项目名称:ProgressManager,代码行数:32,代码来源:a.java

示例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();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:36,代码来源:FragmentActivity.java

示例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;
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:13,代码来源:IntentUtils.java

示例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() {
    }
  });
}
 
开发者ID:JustKiddingBaby,项目名称:FragmentRigger,代码行数:41,代码来源:SharedTargetFragment.java

示例12: getIntArray

import android.os.Bundle; //导入方法依赖的package包/类
public int[] getIntArray(Bundle state, String key) {
    return state.getIntArray(key + baseKey);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:Injector.java

示例13: onRestoreInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onRestoreInstanceState(Bundle bundle) {
    super.onRestoreInstanceState(bundle);
    mLazySpanLookup.mData = bundle.getIntArray(LOOKUP_BUNDLE_KEY);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:StaggeredGridLayoutHelper.java

示例14: getIntArray

import android.os.Bundle; //导入方法依赖的package包/类
public int[] getIntArray(Bundle state, String key) {
    return state.getIntArray(key + mBaseKey);
}
 
开发者ID:evernote,项目名称:android-state,代码行数:4,代码来源:InjectionHelper.java

示例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);
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:42,代码来源:GameView.java


注:本文中的android.os.Bundle.getIntArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。