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
11
votes
3 answers

Correctly implementing PagerAdapter in Android

I have problems with implementation of my custom PagerAdapter and using it with a ViewPager. This sample PagerAdapter has 10 items, every item is a button with it's index as text. When I run my program, I see a button with text '1' insted of '0'.…
oriskop
  • 131
  • 1
  • 1
  • 5
10
votes
1 answer

Difference between FragmentPagerAdapter with ViewPager with OffScreenLimit set to 1 and FragmentStatePagerAdapter?

What is the difference between FragmentPagerAdapter with ViewPager with OffScreenLimit set to 1 and FragmentStatePagerAdapter? About FragmentPagerAdapter Google's guide says: This version of the pager is best for use when there are a handful of …
10
votes
4 answers

Android PagerAdapter not reporting correct position if click previous item

I have a ViewPager w/ negative margins set to get an effect like this: Now, what I want to happen is that when I click on a view to the left or to the right of the current view. It should select that view and call setCurrentItem() on the ViewPager.…
Karim Varela
  • 7,562
  • 10
  • 53
  • 78
10
votes
5 answers

PagerAdapter class getting called multiple times

I am working on an application which has a ViewPager view in it, I have created a PagerAdapter, which has the view, instantiateItem() method of PagerAdapter is called twice in create() i don't know why, can anyone help me with this? Here is my…
hemant
  • 564
  • 2
  • 13
  • 37
9
votes
1 answer

Problems with FragmentPagerAdapter

I'm trying to make a slidescreen with viewpager and fragments so that I can load different layouts per fragment and give each page different functionality. I followed a tutorial to accomplish this. The error I'm getting when hovering over public…
8
votes
2 answers

How to feed data to PagerAdapter

I am using this example to use a ViewPager and a PagerAdapter. But how could I feed the PagerAdapter with data from a adapter like CursorAdapter where I load the data using a CursorLoader? The .setAdapter() on the ViewPager only takes a…
OKA
  • 1,453
  • 2
  • 11
  • 7
8
votes
2 answers

Disable swipe in fragmentPagerAdapter? - android

I have a fragmentPagerAdapter with 3 fragments in it. How would I disable the swiping between the 3 fragments so the user only uses the tabview to go between fragments? private class ViewPagerAdapter extends FragmentPagerAdapter { …
8
votes
1 answer

FragmentPagerAdapter not restoring fragments upon Orientation Change

EDIT: I found out that the Activity is saving the instance, but the Fragments saved data is not making it up to the Activity savedInstanceState. I'm saving the current time in the outState, but its not making its way all the way up, as the…
7
votes
1 answer

Why am i getting stackoverflow error in android-pageradapter?

i just want to inflate one xml file and show it in viewpager pages. lll logcat: FATAL EXCEPTION: main java.lang.StackOverflowError at…
7
votes
2 answers

How to delete item from viewpager and pageradapter

I am using pageradapter and viewpager to display imageview array,textview array .But how do I delete pager on button click .Entire code in the code below ,but I have added button in xml onclick should delete the…
jason
  • 3,932
  • 11
  • 52
  • 123
7
votes
1 answer

updating viewpager with fragments in a new order

I have a ViewPager set up that is drawing the data for its pages (views) from data passed down from a server. On occasion, the server will send down new data that will re-order the views (and sometimes add new views) and I need to make that happen…
7
votes
2 answers

(R.dimen.padding_medium) Cannot be resolved or is not a field?

I'm trying to create a new gallery style app since Gallery got depreciated. The main problem that I am having is that when I try to run the following code I can't shake the error "dimen cannot be resolved or is not a field". I've read some website…
7
votes
2 answers

Save State and Restore State in FragmentStatePagerAdapter

I a using ViewPager with FragmentStatePageAdapter on my screen I have 5 pages which has lots of images and views. Currently I have mViewPager.setOffscreenPageLimit(1); so only current, previous and next will be in memory and other 2 will be…
6
votes
3 answers

Imageview and PagerAdapter

I want to put images in each pages of my ViewPager (like a book). Those images came from a list of url : My Adapter looks like this : private class MyPagerAdapter extends PagerAdapter{ @Override public int getCount() { return…
6
votes
2 answers

UserVisibleHint is false on selected ViewPager Fragment managed by FragmentStatePagerAdapter

I've encountered a really hard to diagnose issue in an Android app. getUserVisibleHint() returns false on the currently selected fragment in a ViewPager when it should return true (because it is visible and selected). I've characterized the…
1
2
3
28 29