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

How to access viewpager from a view from the pageradapter?

I have a ViewPager and a custom PagerAdapter. In the pager adapter there is a view that onClick I would like to move to the next page. I implemented the following: @Override public Object instantiateItem(final ViewGroup container, int position)…
Jim
  • 18,826
  • 34
  • 135
  • 254
2
votes
0 answers

Custom adapter for multiple fragments in one tab of ViewPager

I want to want to make ViewPager with each tab containing three fragments. FragmentPagerAdapter only works for one fragment, so I tried my best to make my own custom adapter extending PagerAdapter. Unfortunately, the code I wrote only displays these…
2
votes
2 answers

Textview is not updating based on position inside pageradapter

Hi I have a problem with pager adapter where i cannot update textview when button is clicked based on position.the code is below These are the two buttons inside my singleview of pageradapter class.
Hari krishna
  • 1,142
  • 1
  • 12
  • 29
2
votes
2 answers

FragmentStatePagerAdapter first call to getItem wrong with sdk 22-->23 upgrade

UPDATE 2: Getting rid of all v4 support references fixed it. UPDATE: I started from scratch to see what triggers this behavior. It occurs once I add a check for location permissions. I can't go backwards -- even when I strip out all the permissions…
2
votes
3 answers

Moving view pager to first item when the end of view pager is reached

Following is my instantiateItem method @Override public Object instantiateItem(ViewGroup container, int position) { View itemView = mLayoutInflater.inflate(R.layout.pager_item, container, false); ImageView imageView =…
user3600801
2
votes
2 answers

Android ViewPager - OutOfMemory Exception using Glide (on phones and on TV)

I'm using ViewPager in my app for showing pictures (from camera, etc. so it can be large pictures). Also I'm using Glide library for loading pictures from Uri to ImageView. This is my PagerAdapter: public class GalleryPagerAdapter extends…
2
votes
1 answer

Pager adapter not registering when I get to last item

I have a pager adapter that displays the content on my app. I wanted it to remember the place where it is at for when the orientation is changed. It works perfectly for all cases, except when I go to the last tab. It displays it fine, but when I…
Marshall
  • 1,353
  • 3
  • 17
  • 38
2
votes
1 answer

Saving the state of a viewpager using views as pages and not fragments

I have a viewpager that uses custom views and not fragments as pages. this custom view is basically a linearlayout with an imageview since am using my viewpager to show images. However when screen orientation changes, everything disappears.…
2
votes
1 answer

Android: Get fragment from PagerAdapter

So I'm trying to implement a ViewPager with a custom FragmentStatePagerAdapter. In my MainActivity, I'm trying to access the fragment being displayed so I can modify the children inside of that fragment's view. Here's the custom fragment: public…
2
votes
0 answers

Updating the GridView inside the ViewPager using the PagerAdapter

I have used GridView inside the ViewPager, and when I try to update the GridView using the gridViewAdapter.notifydatasetchanged(), it doesn't updates. But when I scroll through all the pages and comes back to the original page, it shows the updated…
2
votes
1 answer

How to get the current fragment when using FragmentStatePagerAdapter

It is surprisingly difficult to get the current fragment when using either of the pager adapters. With the FragmentPagerAdapter, however, you can look for a fragment with the tag "android:switcher:" + viewId + ":" + id. Unfortunately, there does not…
Shawn Lauzon
  • 6,234
  • 4
  • 35
  • 46
2
votes
0 answers

Need to manually destroy ViewPager items?

I'm using a fragment with a ViewPager with a custom PagerAdapter to display bitmap images. The bitmaps are loaded with the BitmapFactory on demand in the instantiateItem method and recycled in destroyItem. So while swiping left and right only 3…
MatF
  • 1,728
  • 2
  • 14
  • 31
2
votes
1 answer

How to affect item in ViewPager when it comes to the screen

I am building a gallery app. I have an inner class in my MainActivity that extends PagerAdapter: private class ImagePagerAdapter extends PagerAdapter{ @Override public int getCount() { return images.size(); } @Override …
Oleh Liskovych
  • 991
  • 3
  • 13
  • 31
2
votes
1 answer

ViewPager Lagging Issues in Android

I am having problem in ViewPager Smoothly Swiping. My goal is to download the images from URL using Volley Library and must shown downloaded images in ViewPager without any lagging issue during swiping left to right or right to left. I have…
2
votes
2 answers

View pager showing nothing(blank)

I'm implementing ViewPager to show images . (Swipe to show next and previous ). For that I've created ViewPager and have overridden necesssary methos as below. I'm dynamically creating imageviews and adding them to a LL . But on running it's just…
Apsaliya
  • 136
  • 3
  • 10