Questions tagged [android-viewpager]

ViewPager.setcurrentItem( ) freezes ui

The ViewPager is a widget for Android that makes possible displaying different views (or fragments) side by side allowing the user to swipe between them. ViewPager was released as part of the Compatibility Package revision 3 and works with Android 1.6 upwards. ViewPager is a ViewGroup and works in a similar manner to AdapterViews (like ListView and Gallery).

Official Documentation

10802 questions
4
votes
1 answer

How to call some method for Fragment which is in FragmentPagerAdapter?

I have following issue. I have ViewPager and FragmentPagerAdapter for it. All I need to do is call some method from my Fragment which is in ViewPager when this page was selected. I tried to keep all my Fragments in List inside my adapter, but the…
Dmitriy
  • 830
  • 3
  • 15
  • 29
4
votes
1 answer

How to create a new ViewPager everytime I instantiate the fragment(create it again)? (Pager is surviving the fragment destruction.)

How to create a new ViewPager everytime I remove the fragment(create it again)? My pager is surviving the fragment destruction. I have a ViewPager inside a Fragment, but when I remove the fragment from the FrameLayout where it is and the add it…
adheus
  • 3,985
  • 2
  • 20
  • 33
4
votes
2 answers

ListView inside a Fragment used in a ViewPager does not behave like expected

I am having an issue with the items in this list view. Normal behaviour is that when user taps in one item, the background color changes to orange. This is not happening to my app, and I can't figure out why. The main.xml has just…
4
votes
2 answers

Android ViewPager - How to add buttons to the pages?

I am following this link to do a ViewPager http://blog.stylingandroid.com/archives/537 I managed to get the various pages out. But how do I populate or fill these pages with buttons? instantiateItem() This creates the view for a given position.…
humansg
  • 735
  • 3
  • 12
  • 30
4
votes
1 answer

Android ViewPager - adding slideshow with fade-in/out animation to switch between views

I use ViewPager to implement my own image gallery. The views consists of ImageViews. The user can normally navigate between images using gestures (as in ViewPager). What I want to add is the slideshow feature. When user chooses an option…
cubesoft
  • 3,448
  • 7
  • 49
  • 91
4
votes
1 answer

Android Background color changes using ViewPager in ICS

When I flip through the pages of a ViewPager, the background of a LinearLayout keeps changing from the grey color set in the Theme to white, and it do that only when flipping through pages, only in portrait mode and only in ICS. It's perfectly…
4
votes
1 answer

ViewPager with ContextMenu which is different for each view

I have a ViewPagerActivity with two views. I want to register a context menu, different for each view. I tried a few things (registerForContextMenu()) but I always ended up with both views behaving like the second one. Any ideas? public class…
user219882
  • 15,274
  • 23
  • 93
  • 138
4
votes
1 answer

How do I use preferences on fragments with ViewPager?

I am using ViewPager to swipe through different fragments. It is working but now I want to add settings for each fragment as you can do with Activities in this way: @Override protected void onCreate(Bundle savedInstanceState) { // TODO…
3
votes
0 answers

ViewPager + TabsAdapter + Fragment

Possible Duplicate: Android PagerView between Activities I want to have a viewpager with tabs, and a fragment class that each have their respective xml layout file. How do I accomplish this? This is what i have so far, but it comes an error in…
sweggersen
  • 2,342
  • 1
  • 22
  • 27
3
votes
1 answer

Communication between ViewPager and current Fragment

I'm using a ViewPager ( http://developer.android.com/reference/android/support/v4/view/ViewPager.html ) with some images in Fragments, and because I want to support zooming I am extending ViewPager and overriding: onInterceptTouchEvent The next…
selsine
  • 2,813
  • 2
  • 21
  • 22
3
votes
1 answer

Change initial page to be shown in ViewPagerIndicator

I have implemented the ViewPagerIndicator with ActionBarSherlock. Now i would like to open a specific fragment inside the viewpager once the viewpager is created. Normally you should use setCurrentItem(pageid) or setViewPager(mPager, pageid); But…
user1255553
  • 960
  • 2
  • 15
  • 27
3
votes
1 answer

Adding separate Fragment apart from Fragment Tabs with ViewPager

I'm having some trouble adding a Fragment apart from the Fragments I have linked to each of my Tabs. In other words, I want to be able to swipe between Fragments with ViewPager, but I don't want the first Fragment to be one of the Tabs. My Adpater…
adneal
  • 30,484
  • 10
  • 122
  • 151
3
votes
2 answers

Can ViewPager show more than 1 view at a time?

I found this example of how to use ViewPager and it's pretty simple to follow along. Now I'm wondering, can the ViewPager can show multiple views at the same time? If I have 10 items in the PagerAdapter can I have it show views 1, 2, and 3 first…
Nick
  • 4,556
  • 3
  • 29
  • 53
3
votes
2 answers

Android:Display a temp image while page loading

I am trying to display image before the page is fully loaded in a webView but the webview is displaying blank for few moment and then displaying the desided page the amount of time its showing blank screen i want to display some image.I am using…
Akram
  • 7,548
  • 8
  • 45
  • 72
3
votes
1 answer

Button onClick in viewPager?

I've got a viewPager, and in second page i've got a button. I want it to do something onClick but it's not doing. I've done on xml file: android:onClick="buttonClick" And also i've tried setOnClickListener both inside and outside of…
yahya
  • 4,810
  • 3
  • 41
  • 58
1 2 3
99
100