Questions tagged [android-pageradapter]

A base class providing the Adapter used to populate pages inside of a ViewPager.

Base class providing the Adapter used to populate pages inside of a ViewPager. You will most likely want to use a more specific implementation of this, such as FragmentPagerAdapter or FragmentStatePagerAdapter.

More information can be found in the documentation of the class.

Tag Usage:

427 questions
2
votes
1 answer

Showing specified page when view pager is first created

I have a fragment that contains a ViewPager. This ViewPager is backed by a PagerAdapter that uses a Cursor. The cursor is managed by LoaderCallbacks. I'm using the v4 support libraries here. What I want is to create the fragment and have the view…
2
votes
2 answers

ViewPager re-instantiates items out of order after screen rotation

I'm using a ViewPager that contains several ListViews, with code similar to that in the answer for Infinite ViewPager. The idea is to have something like the day view for the Google Calendar app (whose source seems to be unavailable; only the…
1
vote
1 answer

Adding click listener to two buttons in PagerAdpater CardViews

In my project, I have a PagerAdapter to inflate CardViews that hold text objects created by the user. On each CardView I have edit and delete buttons to access methods to do with the ArrayList holding the text objects. I have coded an interface in…
1
vote
0 answers

Is the value returned by PagerAdapter getCount() expected to remain static?

Or is it perfectly fine to increase the value returned as the user scrolls through the views? In all examples for a PagerAdapter the value returned is the size of some Collection, thus a static value. The API also doesn't specify wether the value…
1
vote
1 answer

How to Get PagerAdapter item Id for Horizontal ViewPager?

I have implemented Horizontal ViewPager with Custom PagerAdapter like attached in screen. What I'm trying to achieve is to get Id of First item from list . Here is code code for everything till now . PagerAdapter: private static final String TAG =…
1
vote
0 answers

How to fix viewpager adapter behaviour incosistent state after swipe view

I am working on slide video with view pager, pager adapter functionality. my view pager holds Video view and play video button to display video and play video from gallery. i have implemented pager adapter to display video. Problem is when my…
Dens
  • 125
  • 11
1
vote
1 answer

Why my pager adapter cant show the data that I load from openweather(as json format) cant show properly

Why my pager adapter cant show the data that I load from openweather(as json format) cant show properly. I got five page in the slide view and the data in the first page will not show unless I load to the third page and the data in second page will…
Choy Wing Lun
  • 63
  • 1
  • 7
1
vote
1 answer

How to start activity to selected fragment?

how to start activity to selected fragment? this is my fragment list and i need start actvity to topTygodnia() how do it? val adapter = ViewPageAdapter(supportFragmentManager) adapter.addFragmenr(Sciana(), "Posty") …
1
vote
0 answers

LoadData() in OnCreateView of Fragment in TabView called Twice

Once my application is Login I start ActivityTwo. In ActivityTwo I am immediately calling TabView Fragment which hold my three Tabs.This is code in ActivityTwo to call TabView Fragment @Override protected void onCreate(Bundle…
1
vote
5 answers

How to refresh data in a RecyclerView from a PagedListAdapter?

Using the following lines of code, I can to display data from a backend server in a RecyclerView using PagedListAdapter. movieViewModel = ViewModelProviders.of(this).get(MovieViewModel.class); MovieAdapter adapter = new…
1
vote
0 answers

ViewPager in a ScrollView with dynamic page heights

I've read many other SO answers but nothing seems to be what I want. What I want is a ViewPager inside a ScrollView with the heights of each page being appropriate for the content. Some of the more accepted answers on SO seem to have to take the max…
1
vote
4 answers

FragmentPagerAdapter strange behavior

So i have the next problem with FragmentPagerAdapter. I have a TabLayout with 3 tabs representing 3 fragments that i can switch. So when i switch to third fragment, for some reason the first one disappears (or its view). Does anyone know how to fix…
1
vote
1 answer

Image Slider using View Pager with Pager Adapter in Xamarin Android C#

I'm trying to create imageslider using viewpager with pageradapter. Everything seems fine but when I run it I'm getting error and it says "System.NullReferenceException: Object reference not set to an instance of an object." I don't know what to do.…
1
vote
1 answer

How to add AnimationDrawable inside a ViewPager?

I'm trying to add an AnimationDrawable in the first page of a ViewPager. The idea is that every time I get into the first page the animation will resume from the most recent frame. The problem is that when I flip back from the third page to the…
1
vote
0 answers

how to override getItemPosition in PagerAdapter

I am trying to update position value by overriding getItemPosition() but it is not working. Please help.. Code here - @Override public int getItemPosition(Object object) { super.getItemPosition(object); SharedPreferences pos =…