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
0 answers

Image not loading in first page of ViewPager (PagerAdapter)

I am new to android development and I am attempting to create a ViewPager with a custom PagerAdapter. In my page adapter layout, I have an CircleImageView and I'm using Ion with a overridden Future callback to download and set the image. However,…
csm232s
  • 1,660
  • 4
  • 32
  • 60
2
votes
1 answer

Custom PagerAdapter, override setPrimaryItem method calling continuously

I am using custom PagerAdapter in my application, in that override the method setPrimaryItem. When I view the html using webview through PagerAdapter, the setPrimaryItem method is keep on calling continuously. Because of that html is flickering in…
2
votes
1 answer

Remove more than one view on PagerAdapter

I've been working with the adapter that is showed at dynamically add and remove view to viewpager, but not all is working fine. My ViewPager contains some custom views with webViews. What I've done is a extending class of PagerAdapter that…
2
votes
2 answers

ListFragment with pagerAdapter

Please help a newbie out... I am using this code as an example/learining exercise LINK In tis example program there are three swipeable tabs using fragments. I have created a new ListFragment that I would like to display in one of the tabs, but…
nmiltner
  • 207
  • 1
  • 2
  • 12
2
votes
0 answers

ViewPager with simple Pager Adapter not working

I have a fragment with a ViewPager inside it; and here is my adapter class. public class QuotesAdapter extends PagerAdapter { private LayoutInflater inflater; private Context context; private Drawable favChecked, favUnChecked; …
2
votes
0 answers

Robolectric test of ViewPager not calling instantiateItem in Pagerdapter

I have a simple PageAdapter implementation that works in the app, but I am unable to create a unit test for the Fragment containing it. The getCount() method in the adapter is called and my mock data returns a count of 1 item to display, but…
2
votes
1 answer

PagerAdapter getCount() is called many times

I am using FragmentStatePagerAdapter. for some reason the getCount() method is beeing called a lot of times before any fragment is even visible... Is it a normal behavior?
roiberg
  • 13,629
  • 12
  • 60
  • 91
2
votes
2 answers

How to implement zoomable ImageView inside ViewPager?

My only problem is that when the Image is Zoomed, it is overlapping with the previous and next element of the pager. ViewPager Without Zoom After Zoom Images Are overlapping
2
votes
4 answers

findViewById is not defined by Fragment

AutoCompleteTextView autoCompView = (AutoCompleteTextView) findViewById(R.id.autocomplete_city); Gives me an error The method findViewById is undefined for the type CityFragment. with: public class CityFragment extends Fragment { …
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
2
votes
1 answer

Calling notifyDataSetChanged from instantiateItem()

I have a requirement to show a ViewPager displaying initially just one View. Once this View goes through measure & layout pass, depending on the result of these I might need to change the contents of the adapter. While doing so, I've come across a…
woot
  • 3,671
  • 4
  • 26
  • 39
2
votes
1 answer

When to call AsyncTask in Fragments in a ViewPager?

I have a ViewPager of fragments. For each fragments, in the onCreateView(), I use AsyncTask to query the server. I create the fragments in FragmentPagerAdapter's getItem(). However, because getItem() method will be called for the visible fragment…
2
votes
2 answers

left/right and up/down swiping navigation

I am considering creating an Android app as part of a wider art project, and having no experience in Android development need to check if something is possible/feasible. It requires a very simple interface, navigating between several (15 - 20) pages…
dantibb
  • 115
  • 1
  • 2
  • 9
2
votes
3 answers

PagerAdapter class instantiateItem getting called twice automatically in onCreate

I am new with viewpager, i want to create view using viewpager, here all the things are dynamic, so i followed this way, My problem is that instantiateItem() is getting called twice oncreate. Oncreate { pager = (ViewPager)…
hemant
  • 564
  • 2
  • 13
  • 37
2
votes
1 answer

Cyclic View Pager with dynamic data

I am facing an issue with the ViewPager to make it cyclic. I have a list of data which is dynamic and everytime a swipe is made the view has to be updated with dynamic data. For example, I have some 5 objects in list say A,B,C,D,E I am able to swipe…
Lavanya
  • 3,903
  • 6
  • 31
  • 57
2
votes
1 answer

Have misunderstanding with PagerAdapter for ViewPager. InstantianteItem method never gets called

Here is my simple PagerAdapter and onCreate() of activity for paging. public class MPagerAdapter extends PagerAdapter{ List pages = null; public MPagerAdapter(List pages){ this.pages = pages; } …
Factory Girl
  • 910
  • 4
  • 18
  • 29