Java Code Examples for android.os.Bundle.getParcelableArrayList()

The following are Jave code examples for showing how to use getParcelableArrayList() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: UpdogFarmer   File: GamesFragment.java   View Source Code Vote up 7 votes
@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);
}
 
Example 2
Project: Shared-Route   File: FailFragment.java   View Source Code Vote up 7 votes
@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;
}
 
Example 3
Project: DailyTech   File: MainActivity.java   View Source Code Vote up 7 votes
@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)
    }

}
 
Example 4
Project: Phoenix-for-VK   File: AbsAttachmentsEditPresenter.java   View Source Code Vote up 7 votes
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);
        }
    }
}
 
Example 5
Project: Watermark   File: MediaPageFragment.java   View Source Code Vote up 6 votes
@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);
}
 
Example 6
Project: NeoTerm   File: TabSwitcherModel.java   View Source Code Vote up 6 votes
@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);
    }
}
 
Example 7
Project: anitrend-app   File: BottomSheetLikes.java   View Source Code Vote up 6 votes
@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);
    }
}
 
Example 8
Project: Protein   File: UserShotListPresenter.java   View Source Code Vote up 6 votes
@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));
}
 
Example 9
Project: simple-share-android   File: MoveFragment.java   View Source Code Vote up 6 votes
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	Bundle args = getArguments();
	if(null != args){
		docs = args.getParcelableArrayList(EXTRA_DOC_LIST);
	}
}
 
Example 10
Project: anitrend-app   File: PublicStatusFragment.java   View Source Code Vote up 6 votes
@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);
    }
}
 
Example 11
Project: anitrend-app   File: AnimeWatchFragment.java   View Source Code Vote up 6 votes
@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;
}
 
Example 12
Project: easyfilemanager   File: MoveFragment.java   View Source Code Vote up 6 votes
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	Bundle args = getArguments();
	if(null != args){
		docs = args.getParcelableArrayList(EXTRA_DOC_LIST);
	}
}
 
Example 13
Project: Protein   File: ShotListPresenter.java   View Source Code Vote up 6 votes
@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));
}
 
Example 14
Project: boxing   File: AbsBoxingViewActivity.java   View Source Code Vote up 6 votes
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);
    }
}
 
Example 15
Project: planetcon   File: ListPlayersPreference.java   View Source Code Vote up 6 votes
@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();
}
 
Example 16
Project: anitrend-app   File: DefaultListFragment.java   View Source Code Vote up 6 votes
@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);
    }
}
 
Example 17
Project: RunMap   File: V2MainFragModel.java   View Source Code Vote up 6 votes
public boolean restore(Bundle bundle){
    if(bundle == null){
        return false;
    }
    mContentListModel = bundle.getParcelableArrayList(KEY_V2EXBEAN);
    return mContentListModel != null && !mContentListModel.isEmpty();
}
 
Example 18
Project: Phoenix-for-VK   File: SelectProfilesActivity.java   View Source Code Vote up 6 votes
@Override
public void onCreate(Bundle savedInstanceState) {
    this.mLayoutRes = R.layout.activity_main_with_profiles_selection;
    super.onCreate(savedInstanceState);
    super.mLastBackPressedTime = Long.MAX_VALUE - DOUBLE_BACK_PRESSED_TIMEOUT;

    this.mSelectableCriteria = getIntent().getParcelableExtra(Extra.CRITERIA);

    if (savedInstanceState != null) {
        mSelectedUsers = savedInstanceState.getParcelableArrayList(SAVE_SELECTED_USERS);
    }

    if (mSelectedUsers == null) {
        mSelectedUsers = new ArrayList<>();
    }

    RecyclerView.LayoutManager manager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
    mProfilesAdapter = new SelectedProfilesAdapter(this, mSelectedUsers);
    mProfilesAdapter.setActionListener(this);

    mRecyclerView = findViewById(R.id.recycleView);
    if (mRecyclerView == null) {
        throw new IllegalStateException("Invalid view");
    }

    mRecyclerView.setLayoutManager(manager);
    mRecyclerView.setAdapter(mProfilesAdapter);
}
 
Example 19
Project: yabaking   File: StepsNavigationActivity.java   View Source Code Vote up 5 votes
private void processSavedInstanceState(Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        steps = savedInstanceState.getParcelableArrayList(LAST_KNOWN_STEPS);
        currentStepListPosition = savedInstanceState.getInt(LAST_KNOWN_CURRENT_STEP_LIST_POSITION);
    }
}
 
Example 20
Project: MyCalendar   File: ChooseSubjectDialogFragment.java   View Source Code Vote up 5 votes
private void initData() {
    mActivity = getActivity();
    mDbHelper = new DBHelper(mActivity);
    Bundle bundle = getArguments();
    mChooseSubjectList = bundle.getParcelableArrayList(CHOOSE_SUBJECT_LIST);
}