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


Java Bundle.getParcelableArrayList方法代碼示例

本文整理匯總了Java中android.os.Bundle.getParcelableArrayList方法的典型用法代碼示例。如果您正苦於以下問題:Java Bundle.getParcelableArrayList方法的具體用法?Java Bundle.getParcelableArrayList怎麽用?Java Bundle.getParcelableArrayList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.getParcelableArrayList方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    steamId = getArguments().getLong(STEAM_ID);
    viewModel = ViewModelProviders.of(this).get(GamesViewModel.class);
    viewModel.init(SteamWebHandler.getInstance(), steamId);
    if (savedInstanceState != null) {
        currentGames = savedInstanceState.getParcelableArrayList(CURRENT_GAMES);
        currentTab = savedInstanceState.getInt(CURRENT_TAB);
    } else {
        currentGames = getArguments().getParcelableArrayList(CURRENT_GAMES);
        currentTab = getArguments().getInt(CURRENT_TAB);
        if (steamId == 0) {
            Toast.makeText(getActivity(), R.string.error_not_logged_in, Toast.LENGTH_LONG).show();
        }
    }
    setHasOptionsMenu(true);
}
 
開發者ID:steevp,項目名稱:UpdogFarmer,代碼行數:19,代碼來源:GamesFragment.java

示例2: onCreateView

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view =inflater.inflate(R.layout.fragment_fail, container, false);
    listView = (ListView)view.findViewById(R.id.fail_fragment_listView);
    adapter = new ConfirmFinishedAdapter(getActivity());
    Bundle bundle = getArguments();
    listItemList= bundle.getParcelableArrayList("listItemList");
    for (listItem e:listItemList) {
        adapter.add(e);
    }
    mAnimAdapter = new SwingBottomInAnimationAdapter(adapter);
    mAnimAdapter.setAbsListView(listView);
    listView.setAdapter(mAnimAdapter);
    return view;
}
 
開發者ID:Luodian,項目名稱:Shared-Route,代碼行數:18,代碼來源:FailFragment.java

示例3: onCreate

import android.os.Bundle; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    getActivityComponent().inject(MainActivity.this);

    setUnBinder(ButterKnife.bind(this));

    mPresenter.onAttach(this);

    setUp();


    if (savedInstanceState != null) {
        ArrayList<Article> articles = savedInstanceState.getParcelableArrayList(EXTRA_ARTICLES);
        adapter.setDataAdapter(articles);
        hideLoading();
        swipeToRefresh(false);
        flag = true; //restore flag to old state(i.e. true)
    }

}
 
開發者ID:ansh94,項目名稱:DailyTech,代碼行數:24,代碼來源:MainActivity.java

示例4: AbsAttachmentsEditPresenter

import android.os.Bundle; //導入方法依賴的package包/類
AbsAttachmentsEditPresenter(int accountId, @Nullable Bundle savedInstanceState) {
    super(accountId, savedInstanceState);
    if (nonNull(savedInstanceState)) {
        currentPhotoCameraUri = savedInstanceState.getParcelable(SAVE_CURRENT_PHOTO_CAMERA_URI);
        textBody = savedInstanceState.getString(SAVE_BODY);
        timerValue = savedInstanceState.containsKey(SAVE_TIMER) ? savedInstanceState.getLong(SAVE_TIMER) : null;
    }

    data = new ArrayList<>();
    if(nonNull(savedInstanceState)){
        ArrayList<AttachmenEntry> savedEntries = savedInstanceState.getParcelableArrayList(SAVE_DATA);
        if(nonEmpty(savedEntries)){
            data.addAll(savedEntries);
        }
    }
}
 
開發者ID:PhoenixDevTeam,項目名稱:Phoenix-for-VK,代碼行數:17,代碼來源:AbsAttachmentsEditPresenter.java

示例5: onViewCreatedOk

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onViewCreatedOk(View view, @Nullable Bundle savedInstanceState) {
    mCbCheck = (AppCompatCheckBox) view.findViewById(R.id.cb_page_check);
    mViewPager = (ViewPager) view.findViewById(R.id.view_pager_page);
    mRlRootView = (RelativeLayout) view.findViewById(R.id.rl_page_root_view);
    mScreenSize = DeviceUtils.getScreenSize(getContext());

    mMediaBeanList = new ArrayList<>();
    if (savedInstanceState != null) {
        List<MediaBean> mediaList = savedInstanceState.getParcelableArrayList(EXTRA_MEDIA_LIST);
        mItemClickPosition = savedInstanceState.getInt(EXTRA_ITEM_CLICK_POSITION);

        if (mediaList != null) {
            mMediaBeanList.addAll(mediaList);
        }
    }
    mMediaPreviewAdapter = new MediaPreviewAdapter(mMediaBeanList,
            mScreenSize.widthPixels, mScreenSize.heightPixels, mConfiguration
            , ThemeUtils.resolveColor(getActivity(), R.attr.gallery_page_bg, R.color.gallery_default_page_bg),
            ContextCompat.getDrawable(getActivity(), ThemeUtils.resolveDrawableRes(getActivity(), R.attr.gallery_default_image, R.drawable.gallery_default_image)));
    mViewPager.setAdapter(mMediaPreviewAdapter);
    mCbCheck.setOnClickListener(this);
    mViewPager.setCurrentItem(mItemClickPosition);
    mViewPager.addOnPageChangeListener(this);
}
 
開發者ID:Loofer,項目名稱:Watermark,代碼行數:26,代碼來源:MediaPageFragment.java

示例6: 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

示例7: onCreate

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();
    if(args != null) {
        mList = args.getParcelableArrayList(ARG_CONTENT);
        mTitle = args.getString(ARG_TITLE);
    }
}
 
開發者ID:wax911,項目名稱:anitrend-app,代碼行數:10,代碼來源:BottomSheetLikes.java

示例8: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
    user = savedInstanceState.getParcelable(STATE_USER);
    firstPageShots = savedInstanceState.getParcelableArrayList(STATE_FIRST_PAGE_DATA);
    if (firstPageShots == null) {
        firstPageShots = new ArrayList<>();
    }
    setNextPageUrl(savedInstanceState.getString(STATE_NEXT_PAGE_URL));
}
 
開發者ID:gejiaheng,項目名稱:Protein,代碼行數:10,代碼來源:UserShotListPresenter.java

示例9: onCreate

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	Bundle args = getArguments();
	if(null != args){
		docs = args.getParcelableArrayList(EXTRA_DOC_LIST);
	}
}
 
開發者ID:medalionk,項目名稱:simple-share-android,代碼行數:9,代碼來源:MoveFragment.java

示例10: onViewStateRestored

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
    super.onViewStateRestored(savedInstanceState);
    if(savedInstanceState != null) {
        //recyclerView.onRestoreInstanceState(savedInstanceState.getParcelable(VIEW_PARCABLE));
        mPage = savedInstanceState.getInt(MODEL_PAGE);
        isLimit = savedInstanceState.getBoolean(MODEL_LIMIT);
        mData = savedInstanceState.getParcelableArrayList(MODEL_CACHE);
    }
}
 
開發者ID:wax911,項目名稱:anitrend-app,代碼行數:11,代碼來源:PublicStatusFragment.java

示例11: onCreateView

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View root = inflater.inflate(R.layout.fragment_anime_watch, container, false);
    unbinder = ButterKnife.bind(this, root);
    if(savedInstanceState != null) {
        externalLinks = savedInstanceState.getParcelableArrayList(KEY_EXTERNAL_LINKS);
        targetLink = savedInstanceState.getString(KEY_EXTERNAL_TARGET);
        rssFeed = savedInstanceState.getParcelable(KEY_RSS);
        popular = savedInstanceState.getBoolean(KEY_POPULAR);
    }
    return root;
}
 
開發者ID:wax911,項目名稱:anitrend-app,代碼行數:15,代碼來源:AnimeWatchFragment.java

示例12: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
    type = savedInstanceState.getInt(STATE_TYPE);
    firstPageShots = savedInstanceState.getParcelableArrayList(STATE_FIRST_PAGE_DATA);
    if (firstPageShots == null) {
        firstPageShots = new ArrayList<>();
    }
    setNextPageUrl(savedInstanceState.getString(STATE_NEXT_PAGE_URL));
}
 
開發者ID:gejiaheng,項目名稱:Protein,代碼行數:10,代碼來源:ShotListPresenter.java

示例13: parseSelectedMedias

import android.os.Bundle; //導入方法依賴的package包/類
private void parseSelectedMedias(Bundle savedInstanceState, Intent intent) {
    if (savedInstanceState != null) {
        mSelectedImages = savedInstanceState.getParcelableArrayList(Boxing.EXTRA_SELECTED_MEDIA);
        mAlbumId = savedInstanceState.getString(Boxing.EXTRA_ALBUM_ID);
        mStartPos = savedInstanceState.getInt(Boxing.EXTRA_START_POS, 0);
    } else if (intent != null) {
        mStartPos = intent.getIntExtra(Boxing.EXTRA_START_POS, 0);
        mSelectedImages = intent.getParcelableArrayListExtra(Boxing.EXTRA_SELECTED_MEDIA);
        mAlbumId = intent.getStringExtra(Boxing.EXTRA_ALBUM_ID);
    }
}
 
開發者ID:Bilibili,項目名稱:boxing,代碼行數:12,代碼來源:AbsBoxingViewActivity.java

示例14: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        Bundle bundle = (Bundle) state;
        aPlayersPrefs = bundle.getParcelableArrayList("players");
        mListAdapter.setList(aPlayersPrefs);
        super.onRestoreInstanceState(bundle.getParcelable("super"));
    } else {
        super.onRestoreInstanceState(state);
    }
    notifyChanged();
}
 
開發者ID:dftec-es,項目名稱:planetcon,代碼行數:13,代碼來源:ListPlayersPreference.java

示例15: onViewStateRestored

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
    super.onViewStateRestored(savedInstanceState);
    if(savedInstanceState != null) {
        model = savedInstanceState.getParcelableArrayList(KEY_MODEL_STATE);
        mPage = savedInstanceState.getInt(MODEL_PAGE);
        isLimit = savedInstanceState.getBoolean(MODEL_LIMIT);
        isPaginate = savedInstanceState.getBoolean(KEY_PAGINATE);
    }
}
 
開發者ID:wax911,項目名稱:anitrend-app,代碼行數:11,代碼來源:DefaultListFragment.java


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