Tag: android-viewpager

Loader delivers result to wrong fragment

I have an activity with swiping tabs using ActionBar tabs, based on the android developer example. Each tab displays a Fragment, and each Fragment (actually, a SherlockFragment) loads a different kind of remote api request via a custom AsyncTaskLoader. The problem is that if you tap a tab to move 2 tabs/pages over while the […]

NullPointerException when showing a ViewPager a second time

I am using a ViewPager fragment which has two fragments as children. This works great, however when I replace the ViewPager fragment by another fragment and replace this fragment by the ViewPager fragment my application crashes with the following NullPointerException: java.lang.NullPointerException: Attempt to invoke virtual method ‘int java.util.ArrayList.size()’ on a null object reference at android.support.v4.app.FragmentManagerImpl.getFragment(FragmentManager.java:667) […]

How to bring Circle Page Indicator to the front in Android

I have a view pager gallery and a circle page indicator in the bottom of the view. I want to bring page indicator in front of the view pager and make it transparent if it’s possible as like in iphone image gallery. Do you have any idea how to do it ? SOLUTION: Here is […]

Swiping Images in ViewFlipper or ViewPager

I want to show an image at a time. On a swipe I want to change my image with sliding effect. I read about ViewPager and ViewFlipper. I even have an example of doing such with ViewFlipper. Just need a proper explanation on where to use ViewFlipper and where to use ViewPager. It seems to […]

Do not clip ViewPager pages

I can’t get my ViewPager not clipping its pages contents. I’m currently using ViewPager with a FragmentStatePagerAdapter in my application. I have 3 pages, each page is showing a different fragment. Everything works fine, but now I want to be able to draw outside of my pages bounds, like in this image: I set clipChildren […]

Scrolling effect with multiple viewpagers

I have a concept for a view. Please guide me as to how I can achieve it. Please check the wireframe. I have already looked at FadingActionBar but it does not seem to help. The problem is I have multiple viewpagers in the screen and am going no where trying to achieve the desired result. […]

Nesting Android ViewPager, Swiping ListItems inside a ListView horizontally

I have a ViewPager on the root-level of an activity. Each page of the pager contains a ListFragment (backed by a FragmentPagerAdapter). Some of the list view items should contain additionally ViewPagers to support swiping the content of those items (e. g. a horizontal gallery inside a list item). How can I nest view pagers? […]

How to recreate all fragments in ViewPager:

I have this problem, I have a FragmentActivity with a ViewPager and a ViewPagerAdapter. In this ViewPager I have 3 Fragments that each of them contains a TableLayout that gets populated programmaticly using a 2dArrayList. on a click of a button in the FragmentActivity layout, I filter the data in the 2dArrayList and basically need […]

Android: Showing Action Bar menu items depending on ViewPager

I am having trouble getting the following piece of code to work out. I have a viewpager with 3 fragments, and I want a search icon to only show up on one. I started off trying to add the search function by the fragment, but the rendering of the menu item was slow when swiping […]

How to migrate from Gallery to HorizontalScrollView & ViewPager?

I need simple control for icon choosing on Android 2.2 and higher. Gallery was a better solution for me, but it is deprecated and I have to use HorizontalScrollView and ViewPager instead. But how to migrate easy? How to use this classes and controls in this case? I’ve try to find complete example for this […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.