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
3
votes
1 answer

In Action Bar set custom view within fragment

I have an Activity that holds some fragments. This Activity is associated with a view pager, this view pager uses FragmentPagerAdapter, so every page of view pager is treated as a fragment. Now, suppose I have customize the action bar view in any…
3
votes
2 answers

It is possible to use ViewPager and PagerAdapter without android-support-v4.jar library?

android-support-v4.jar has a size of 750kb, thats a lot, and i only need it to use ViewPager and PageAdapter. My app only haves a size of 50kb, it is a huge size increase if i use the support library. It is possible to use ViewPager and PagerAdapter…
3
votes
4 answers

Android Viewpager fragments refreshed when swiped

I am new in Android and I don't really understand why a Fragment's content which was added dynamically (for example some image which was added after a button click) is disappearing after scrolling some count of Fragments and then come back. There is…
3
votes
0 answers

Horizontal and vertical swipe in android using multidimensional array

I am a newbie in Android and currently developing an app in which there should be integration of Horizontal and vertical swipe simultaneously. The horizontal swipe should result into previous and next images. The vertical swipe should result into…
Anu Padhye
  • 615
  • 1
  • 6
  • 16
3
votes
2 answers

save state of views in viewpager

This is a follow up of this question ViewPager and fragments — what's the right way to store fragment's state?. I need someone to interpret this part of the answer in code. Another approach is to override FragmentPageAdapter.instantiateItem(View,…
Jimi
  • 539
  • 5
  • 21
3
votes
2 answers

Multiple Activities under single tab using PagerAdapter in android (Swipeable tabs)

How can I make a single tab with multiple activities? So far, I've developed one little demo(as per below image). Here, there is only one activity in "Check In" tab. Now, suppose I click on a button within "Check In" tab, second activity should…
thumber nirmal
  • 1,639
  • 3
  • 16
  • 27
3
votes
1 answer

Why does my ViewPager have children of zero width and height?

I'm making a ViewPager to display a series of images, which are identified by their position in an array of resource values. Here is my instantiateItem code for the adapter: //indexes the images @Override public boolean isViewFromObject(View arg0,…
Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96
3
votes
1 answer

ListFragments inside ViewPager

I'm writing my first fragment-based app and running into some heavy problems which i couldn't solve with the API or Stackoverflow. I am using a viewPager to swipe between two lists. Each list has a header button to create a new list element (similar…
2
votes
1 answer

Android - Can't update textview within View Pager Adapter

I have a counter view which should update as user touch minus and plus buttons. I'm trying to update counter within ViewPager's adapter instantiateItem method, but it doesn't make any effect. I can update it's value only in instantiateItem. Is there…
2
votes
2 answers

How to stop playing video on view pager swipe in android?

I am using View Pager showing image and video, I am able to show image and video properly but I have problem, when I swipe for video, then video is playing, but I swipe next or previous then video is still playing on just next or previous screen but…
sam chaudhari
  • 756
  • 1
  • 12
  • 24
2
votes
1 answer

How to solve issue with PagerAdapter on Kotlin: "Required method instantiateItem was not overridden"?

So my project is calling Kotlin file to Java : This is the error message (Run Time Error) I got: java.lang.UnsupportedOperationException: Required method instantiateItem was not overridden this is my app gradle apply plugin:…
2
votes
0 answers

Propagating touch events

I have trouble implementing something like Instagram preview image feature (on long press show dialog with enlarged image). So i have Fragment with ViewPager as its child. Adapter responsible for feeding the data to theViewPager has one imageView…
2
votes
1 answer

Scrollable PagerAdapter

I did a PagerAdapter, and it works very well but when I put my phone horizontally, many things like TextView are not visible, because they are "below" the screen of the phone. I know I could put a ScrollView, but this option gives a lot of…
KKKKK
  • 273
  • 2
  • 18
2
votes
2 answers

ViewPager.setCurrentItem Return Wrong Position in PagerAdapter

Here's my tabLayoutCode mTabLayoutBerita.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { …
2
votes
1 answer

FragmentStatePagerAdapter view pager fragments not showing after activity recreate

When my Activity gets recreated via orientation change or if "Don't keep activities" is turned on in developer settings, my ViewPager that has FragmentStatePagerAdapter doesn't recreate fragments. this is activity onCreate method: @Override …