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

out of memory error viewpager + imageView

I am showing 100 images in viewpager, and my application crash ( out of memory error ) when i navigate between these images . I want to use destroyItem to free up memory but it is not worked. Can you help me ? public class ViewPagerAdapter extends…
4
votes
2 answers

How to fire event from fragment in main activity?

I have a Main Activity having one edittext and a viewpager which is getting inflated via two fragments. Both fragment layout contain buttons. My question is how to fire their on click listener in main activity. Like i have a button in one fragment…
Rahul Gupta
  • 5,275
  • 8
  • 35
  • 66
4
votes
1 answer

Implementation of the setTag() and findViewWithTag() in instantiateItem() of the FragmentStatePagerAdapter

Referencing the following answer, I tried to unimplement what I was currently doing in a project, i.e., using the following code: @Override public int getItemPosition(Object object) { return POSITION_NONE; } Because due to the current…
Rakeeb Rajbhandari
  • 5,043
  • 6
  • 43
  • 74
4
votes
0 answers

How to add a Fragment ID or Fragment tag for a fragment in a ViewPager

I have Tabs + ViewPager in my Android app. From the main activity, I want to send some data to these fragments. How do I get these fragments in the first place? I suppose I need to use getSupportFragmentManager().findFragmentById(R.id.--) How do I…
4
votes
4 answers

ViewPager PageTransformer with Support Library v13

My application uses Android's ViewPager with a FragmentStatePagerAdapter and it only needs to support Android 4.x or above. I'm using the v13 support library for the ViewPager so I don't need to deal with SupportFragments, I just have to use…
peteross
  • 236
  • 3
  • 12
4
votes
2 answers

Actionbar Tabs Indicator slide

How can I have fixed tabs with a sliding tab indicator like described here: How to get this type of TAB hairline movement http://www.pushing-pixels.org/2013/05/09/android-bits-and-pieces-sliding-tabs-madness.html &…
just_user
  • 11,769
  • 19
  • 90
  • 135
4
votes
1 answer

Fragment in ViewPager on Fragment doesn't reload on orientation change

I am working on developing an Android application which uses ActionBarSherlock and ViewPagerIndicator. The main activity is a SherlockFragmentActivity and users navigate between the fragments via tabs on the action bar. All of the tabs are…
4
votes
2 answers

How to update listview in fragment when back to previous fragment inside viewpager

Well, Consider I have have two fragments FragmentTab1 & ShowAllContactFragment. FragmentTab1 consists a list-view & and a button. When the button is clicked I replace ShowAllContactFragment in my viewpager. When shows ShowAllContactFragment, user…
4
votes
0 answers

How to disable swipe open in DrawerLayout in Android?

I have an application which is having a home Activity, in that i have used viewpager,Appcompact Actionbar and drawerLayout. The drawerLayout opens in three events. Clicking on actionbar menu. Device menu button Swipe to right from edge and closes…
Sujith
  • 7,543
  • 1
  • 28
  • 38
4
votes
1 answer

How to make unlimited pager using ViewPager in Android

I want to display unlimited viewpager in my calendar when I slide the month view. How can I do that? I think I need 3 fragments to do that. However, I don't know how to update the month (fragment) when I swipe Left or right. I attached my code…
lolyoshi
  • 1,536
  • 3
  • 24
  • 42
4
votes
0 answers

Memory leak with view pager and fragment

In this part of my application there is a ViewPager contents in a fragment, when i replace the fragment contains the viewpager android doesn't clear the memory. How can I clear the memory? this is the adapter for the listview: public class…
4
votes
1 answer

SearchView in Tabs ViewPager

I am following this tutorial. I want to add a SearchView in TabsViewpager as link: Picture 1 http://www.uphinh.vn/image/stream/1386201.png But my app ,SearchView not in TabsViewpager as link:Picture 2 http://www.uphinh.vn/image/stream/1386202.png I…
4
votes
1 answer

Android View Pager which shows a hint of next child

I want to tweak the original View Pager which shows a hint of next child.. see the image below: I tried creating my own ViewPager which extends the original View Pager but i was unable to make it work. I would really appreciate if you can point me…
mudit
  • 25,306
  • 32
  • 90
  • 132
4
votes
1 answer

Impliment Slidingdrawer with viewpager where slidingdrawer resides on the viewpager

I want to display a Viewpager with slidingdrawer.Viewpager is used to scroll the images and on top of that viewpager I want to place one sliding drawer(top to button). i attached my sample code. If you have any idea about how to implement this…
4
votes
2 answers

Android communication between activity and fragment

I have an activity which contains a ViewPager inside it.The ViewPager's Adapter is FragmentStatePagerAdapter. Each page is Fragment.The Fragment contains a number of Threads. My problem is, I have to stop all the threads inside the fragment when…
Jis Jose
  • 614
  • 1
  • 6
  • 15