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

NoClassDefFoundError at DirectionalViewPager using

Need help of people, who used DirectionalViewPager - library for vertical and horizontal ViewPager implementation. I do everything, as it described at DirectionalViewPager. But after creation of sample android project get the 10-02…
4
votes
6 answers

How to know which fragment is currently selected in a ViewPager?

I use ViewPager loaded with fragments in it and I want to know which fragment is currently shown or selected in the viewpager. The onResume() method of each fragments does some logic and so i get problems when the adjacent fragments(left and right)…
user1190521
4
votes
1 answer

Change front fragment when clicking an item on a SlidingMenu

I'm trying to make a sliding menu just like Youtube or Google+ app. I'm following this project code, and what I'm trying to do is when I click on an item on the left bar, the Activity slides back to left with the new content. just like when you are…
rogcg
  • 10,451
  • 20
  • 91
  • 133
4
votes
3 answers

ViewPager & ViewPagerIndicator not displaying anything

I have a problem actually with my app, my ViewPager and ViewPagerIndicator ( http://viewpagerindicator.com/) are not displaying anything and i don't see why. I checked everything multiple times (setting correctly the adapter, adding the view in…
4
votes
1 answer

How can I make viewpager loop?

I want my ViewPager implementation to cycle between views instead of stopping at the last view. For example, if I have 3 views to display via a ViewPager, it should return back to the first View after the third View on fling instead of stopping at…
Erdem Azaklı
  • 255
  • 1
  • 8
  • 27
4
votes
1 answer

Why restoreState() and saveState() of PagerAdapter won't work?

I'm trying to save a current state of the ViewPager (current position etc.) by implementing two methods in its PagerAdapter: restoreState() and saveState(). However they seem to not work correctly in my case. What I'm doing wrong? @Override public…
Marcin S.
  • 11,161
  • 6
  • 50
  • 63
4
votes
1 answer

Android ViewPager performance on Galaxy Tab 2

I have an application which uses Android ViewPager (7 views, pretty complex with images and animations). This application runs fantastically on my Asus Eee Pad. It is just gorgeous. I also have a Galaxy Tab 2 10.1 which almost can not run the app...…
Paul
  • 7,157
  • 6
  • 32
  • 37
4
votes
1 answer

One side ViewPager swiping only

I have a ViewPager in my application and I would like to disable/allow swipe to right side in any time. Every view in the viewpager contains ListView. How can I do that? I am trying to do that in this way: private int oldX; private int deltaX =…
Jan Muller
  • 402
  • 5
  • 8
4
votes
2 answers

Is this effect possible in viewpager?

I am using ViewPager in Activity. I need to have this effect between pages flipping. I have never seen such kind of effect other than in the flipping between home screens of Android. If you have used this animation or if you have heard the name of…
arnp
  • 3,178
  • 6
  • 26
  • 43
4
votes
2 answers

Android create ViewPager programmatically

I create a view pager programmatically and I add this view pager into layout but it doesn't run. ViewPager viewPager = new ViewPager(this); viewPager.setAdapter(new MyPagerAdapter()); addView(viewPager); The view pager is not working; but when I…
nebyan
  • 9,347
  • 1
  • 20
  • 20
4
votes
2 answers

What's the default minimum distance to sucessfully swipe in View Pager?

I'm working on a project for my thesis in which I'm using an app for analyzing swipe gestures. There are a lot of questions and informations around about the view pager in general and even how to manipulate its settings, but until now, I couldn't…
4
votes
2 answers

ActionBar and ViewPager and CursorLoader works, but maybe there is better way

My application loads data from database (ContentResolver) and make tabs in ActionBar with ViewPager. The following code works as expected but I want someone to review my code. I need to know if it complies with the general patterns and practices?…
4
votes
1 answer

Replacing Fragments correctly within ViewPager

I'am trying to replace a fragment within a view, but don't succeed yet. I have the following classes. First my PagerAdapter: package com.example.tab1; import android.os.Bundle; import android.support.v4.app.Fragment; import…
user1563010
  • 41
  • 1
  • 2
4
votes
6 answers

How to set OnClickListener in ViewPager

I'm new to Android development and I'm studying to code & design an Android project. I have problem with ViewPager and can't find answer on this site or via a Google search. Problem: I can't make a Button execute its action while it's in…
hlv_trinh
  • 122
  • 1
  • 1
  • 12
4
votes
3 answers

Android TabsAdapter with ActionbarSherlock

I am using ActionbarSherlock with a SherlockListFragment that implements LoaderManager.LoaderCallbacks. In my ApplicationActivity onCreate method I am using setContentView(R.layout.application); to set the layout -- works great. I am initializing…