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


Java Bundle.putInt方法代码示例

本文整理汇总了Java中android.os.Bundle.putInt方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.putInt方法的具体用法?Java Bundle.putInt怎么用?Java Bundle.putInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.putInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onViewCreated

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ViewPager mViewPager = (ViewPager) view.findViewById(R.id.vp);
    FragmentPagerItems pages = new FragmentPagerItems(getActivity());
    final int page = FragmentPagerItem.getPosition(getArguments());

    for (int i = 0; i < 5; i++) {
        Bundle bundle = new Bundle();
        bundle.putInt("page", page);
        bundle.putInt("position", i);
        pages.add(FragmentPagerItem.of(String.valueOf(i), DemoFragment.class, bundle));
    }
    FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(getChildFragmentManager(), pages); //Fragment嵌套Fragment时,要用getChildFragmentManager
    mViewPager.setAdapter(adapter);
    mViewPager.setOffscreenPageLimit(2);
    mViewPager.setPageMargin(30);
    final MainActivity mainActivity = (MainActivity) getActivity();
    mViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
        @Override
        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
            mainActivity.pageScrolled(page, position, positionOffset);
        }
    });
}
 
开发者ID:simplezhli,项目名称:ChangeTabLayout,代码行数:26,代码来源:PageFragment.java

示例2: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static TransactionPayloadFragment newInstance(int type) {
    TransactionPayloadFragment fragment = new TransactionPayloadFragment();
    Bundle b = new Bundle();
    b.putInt(ARG_TYPE, type);
    fragment.setArguments(b);
    return fragment;
}
 
开发者ID:jgilfelt,项目名称:chuck,代码行数:8,代码来源:TransactionPayloadFragment.java

示例3: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected Parcelable onSaveInstanceState() {
    final Bundle bundle = new Bundle();
    bundle.putParcelable(INSTANCE_STATE, super.onSaveInstanceState());
    bundle.putInt(INSTANCE_TEXT_COLOR, getTextColor());
    bundle.putFloat(INSTANCE_TEXT_SIZE, getProgressTextSize());
    bundle.putFloat(INSTANCE_REACHED_BAR_HEIGHT, getReachedBarHeight());
    bundle.putFloat(INSTANCE_UNREACHED_BAR_HEIGHT, getUnreachedBarHeight());
    bundle.putInt(INSTANCE_REACHED_BAR_COLOR, getReachedBarColor());
    bundle.putInt(INSTANCE_UNREACHED_BAR_COLOR, getUnreachedBarColor());
    bundle.putInt(INSTANCE_MAX, getMax());
    bundle.putInt(INSTANCE_PROGRESS, getProgress());
    bundle.putString(INSTANCE_SUFFIX, getSuffix());
    bundle.putString(INSTANCE_PREFIX, getPrefix());
    bundle.putBoolean(INSTANCE_TEXT_VISIBILITY, getProgressTextVisibility());
    return bundle;
}
 
开发者ID:stytooldex,项目名称:pius1,代码行数:18,代码来源:Num.java

示例4: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override public void onSaveInstanceState(Bundle outState) {
  outState.putInt(ARG_COLOR, color);
  outState.putInt(ARG_TYPE, dialogType);
  super.onSaveInstanceState(outState);
}
 
开发者ID:Blankeer,项目名称:MDWechat,代码行数:6,代码来源:ColorPickerDialog.java

示例5: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static LostAndFoundFragment newInstance(int type, String searchText) {

        Bundle args = new Bundle();
        args.putInt("type", type);
        if (!TextUtils.isEmpty(searchText)) {
            args.putString("searchText", searchText);
        }
        LostAndFoundFragment fragment = new LostAndFoundFragment();
        fragment.setArguments(args);
        return fragment;
    }
 
开发者ID:NICOLITE,项目名称:HutHelper,代码行数:12,代码来源:LostAndFoundFragment.java

示例6: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Usar este constructor para crear una instancia de
 * este fragment con parámetros
 *
 * @param multimedia Parametro 1.
 * @return A devuelve una nueva instancia del fragment.
 */
public static FragmentMultimedia newInstance(ArrayList<Multimedia> multimedia,int idProyecto) {
    FragmentMultimedia fragment = new FragmentMultimedia();
    Bundle args = new Bundle();
    args.putParcelableArrayList(ARG_MULTIMEDIA, multimedia);
    args.putInt(ARG_IDPROYECTO,idProyecto);
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:nen155,项目名称:TFG-SmartU-La-red-social,代码行数:16,代码来源:FragmentMultimedia.java

示例7: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static PoiListFragment newInstance(String poiName, int categoryId) {
    PoiListFragment fragment = new PoiListFragment();
    Bundle args = new Bundle();
    args.putString("poiName", poiName);
    args.putInt("categoryId", categoryId);
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:9,代码来源:PoiListFragment.java

示例8: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static ContactChooserFragment newInstance(ContactId id) {

		Bundle args = new Bundle();

		ContactChooserFragment fragment = new ContactChooserFragment();
		args.putInt(CONTACT_ID, id.getInt());
		fragment.setArguments(args);
		return fragment;
	}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:10,代码来源:ContactChooserFragment.java

示例9: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public Parcelable onSaveInstanceState() {
    Bundle state = new Bundle();
    state.putParcelable("instanceState", super.onSaveInstanceState());
    state.putInt("alpha", alpha);
    state.putFloat("hue", hue);
    state.putFloat("sat", sat);
    state.putFloat("val", val);
    state.putBoolean("show_alpha", showAlphaPanel);
    state.putString("alpha_text", alphaSliderText);

    return state;
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:14,代码来源:ColorPickerView.java

示例10: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
protected final Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    onPtrSaveInstanceState(bundle);
    bundle.putInt(STATE_STATE, this.mState.getIntValue());
    bundle.putInt(STATE_MODE, this.mMode.getIntValue());
    bundle.putInt(STATE_CURRENT_MODE, this.mCurrentMode.getIntValue());
    bundle.putBoolean(STATE_SCROLLING_REFRESHING_ENABLED, this.mScrollingWhileRefreshingEnabled);
    bundle.putBoolean(STATE_SHOW_REFRESHING_VIEW, this.mShowViewWhileRefreshing);
    bundle.putParcelable(STATE_SUPER, super.onSaveInstanceState());
    return bundle;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:PullToRefreshBase.java

示例11: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putParcelable("instanceState", super.onSaveInstanceState());
    bundle.putInt("mCurrentTab", mCurrentTab);
    return bundle;
}
 
开发者ID:LonelyMushroom,项目名称:aarLibrary,代码行数:8,代码来源:SlidingTabLayout.java

示例12: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static NoteFragment newInstance(Note note, int position) {
    NoteFragment noteFragment = new NoteFragment();
    Bundle arguments = new Bundle();
    arguments.putParcelable(ARG_NOTE, note);
    arguments.putInt(ARG_POSITION, position);
    noteFragment.setArguments(arguments);
    return noteFragment;
}
 
开发者ID:Laaidback,项目名称:A.scribe,代码行数:9,代码来源:NoteFragment.java

示例13: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState) {
    outState.putSerializable(MODEL_SAVE_KEY, mModel);
    outState.putInt(NAVIGATION_POSITION, mNavigationIndex);
    outState.putParcelable(MODEL_USER_KEY, mCurrentUser);
    outState.putInt(SHORTCUT_NAVIGATION, mShortcut);
    outState.putLong(TIME_ELAPSE_TRIGGER, mLastSynced);
    outState.putInt(VIEW_PAGER_OFF_SCREEN, mOffScreenLimit);
    super.onSaveInstanceState(outState);
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:11,代码来源:MainActivity.java

示例14: onResult

import android.os.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected Bundle onResult(int which) {
    Bundle results = new Bundle();
    results.putInt(HOUR, picker.getCurrentHour());
    results.putInt(MINUTE, picker.getCurrentMinute());
    return results;
}
 
开发者ID:eltos,项目名称:SimpleDialogFragments,代码行数:9,代码来源:SimpleTimeDialog.java

示例15: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("unused")
public static TripHistoryFragment newInstance(int columnCount) {
    TripHistoryFragment fragment = new TripHistoryFragment();
    Bundle args = new Bundle();
    args.putInt(ARG_COLUMN_COUNT, columnCount);
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:gbl08ma,项目名称:underlx,代码行数:9,代码来源:TripHistoryFragment.java


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