本文整理汇总了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);
}
示例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;
}
示例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)
}
}
示例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);
}
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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));
}
示例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);
}
}
示例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();
}
示例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);
}
}