當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。