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

PagerAdapter ClassNotFoundException when unmarshalling: android.support.v4.view.ViewPager$SavedState

I am using a custom view pager with a PagerAdapter and I get the following crash when I have "Don't keep activities" turned on: android.os.BadParcelableException: ClassNotFoundException when unmarshalling:…
4
votes
1 answer

Cannot instantiate the type PagerAdapter

I am working with fragments and pageview trying to use a horizontal pager and i got the following error: Cannot instantiate the type PagerAdapter. I know that PagerAdapter is an abstract class, so i created a new class that inherits from…
4
votes
5 answers

How to make Pager Sliding Tab Strip with two categories equally fit in screen android?

I am using pager sliding tab strip where I am getting extra space at right side. How to equally fit for two categoreis in tabs? My code is as follows: PagerSlidingTabStrip tabs = (PagerSlidingTabStrip)findViewById(R.id.tabs); …
Shadow
  • 6,864
  • 6
  • 44
  • 93
4
votes
3 answers

Get Fragment by Tag

I am using a FragmentPagerAdapter to create a multi-pages UI with different fragments. What I want to do is to find the Fragment using the position of the Fragment. I have applied the method of finding the nametag of fragments and use…
4
votes
2 answers

First viewpager page blank

I have a problem that relates to Android's ViewPager. I am currently attempting to implement a VerticalViewPager (though that is not relevant to the problem as this same problem occurs with a normal ViewPager) with a custom PagerAdapter that gets…
user2525981
  • 159
  • 1
  • 3
  • 10
4
votes
1 answer

Making an ImageView inside my PagerAdapter go fullscreen - How to?

I'm testing an app with some sort of gallery which I managed to create using PagerAdapter but I can't make the images show on fullscreen. Here are some screenshots: View1 on the screen https://i.stack.imgur.com/9WedM.jpg , Transition from View1 to…
guilhermexot
  • 277
  • 4
  • 11
4
votes
2 answers

FragmentStatePagerAdapter OutOfMemoryError

I'm running into OutOfMemoryErrors in an app that I'm working on and I'm having difficulty figuring out how to fix it and what exactly the issue is. I'm using the FragmentStatePagerAdapter, since that seemed like the best/recommended alternative.…
4
votes
0 answers

Android Fragment Pager and Custom Page Indicator( ViewPagerIndicator created by Jake Wharton)

I am using ViewPageIndicator for developing a pager view with its indicator MyCode Activity public class Pager extends Activity{ private MyPagerAdapter mAdapter; private ViewPager mPager; private CirclePageIndicator…
edwin
  • 7,985
  • 10
  • 51
  • 82
3
votes
2 answers

Making the height of the ViewPager equal to the highest item in the PagerAdapter

I have a ViewPager and use it to swipe between views not Fragments . And when I give the View Pager wrap_content height , it doesn't show anything . So I had to give it a fixed height . But I had another problem , when the item's height is larger…
3
votes
1 answer

How to get the current View from PagerAdapter from a certain position?

I have created a custom class extending PagerAdapterthat represents my adapter to a ViewPager in which I slide through Views (not Fragments). What my problem really is, is that I don't know how to get the current View that I have add to the adapter…
user4811490
3
votes
1 answer

Passing AttributeSet to childs of custom ViewPager via PagerAdapter

My problem - child of ViewPager views can't get attributes from AttributeSet. I make custom ViewGroup including ViewPager: public class CustomCalendarView extends FrameLayout { ... public CustomCalendarView(Context context, AttributeSet attr) { …
3
votes
1 answer

When is android PagerAdapter's instantiateItem called?

I have a viewpager and a pagerAdapter which inflates a custom view and adds it to the collection. After setting up the viewpager and pageradapter, I proceed to get some data which I now want to display in one of the custom views. However I observed…
user2759617
  • 597
  • 1
  • 8
  • 20
3
votes
2 answers

Start new Activity from PagerAdapter

How do I start a new Activity using Intent from PagerAdapter class? This is how my ViewPagerAdapter class looks like. public class ViewPagerAdapter extends PagerAdapter This is how I am trying to start new activity in the OnClickListner method of…
3
votes
1 answer

align PageTabStrip according to the custom ViewPager content width

I have created PageTabStrip and ViewPager to show multiple list fragments. inside my app viewpager content has a specific width ( it doesn't occupy the whole screen ) partial pages are visible. as my ViewPager content has specific width, my…
Hunt
  • 8,215
  • 28
  • 116
  • 256
3
votes
1 answer

ViewPager Out of Memory + ImageView

i try to make ViewPager for Images. But i get a OutOfMemory-Error. I read that i sholud use Bitmaps or do somthing like "reorganize();"... vut i don't understand it... My Code: Adapter: public class app_info_Adapter extends PagerAdapter { private…
Flo
  • 1,179
  • 3
  • 15
  • 43