Tag: android-viewpager

TabLayout and ViewPager -Tabs doesn't work after swiping between sliding drawer items

TabLayout and ViewPager – Click on tabs doesn’t work after swiping between sliding drawer item. I work on app that have Sliding drawer and Tablayout. I refer this tutorials For Sliding Drawer and For TabLayout. Inside Sliding Drawer TaskList –>TabLayout(Tabs(Today,Monthly,Yearly)) Settings Orders I have issue between Sliding Drawer and Tablayout. first time viewpager loads correctly. […]

FragmentPagerAdapter with ViewPager and two Fragments. Go to the first from the second and update first's text

I’m not familiar with FragmentPagerAdapter, so this is going to be one of those questions that we (you) read the description critically. Structure: I have a FragmentPagerAdapter (code below), that will hold two fragments at a time. The first displays book excerpts, and the second a list of book titles. Goal: I want to achieve […]

customize padding and margin in IconPageIndicator

I am trying to implement a custom IconPageIndicator – viewpager. I want to customize the margins and paddings of the icons displayed in com.viewpagerindicator.IconPageIndicator. So I wrote my custom IconPageIndicator and CustomLinearLayout. I changed the dividerPadding variable in CustomLinearLayout. Here is the code. But this doesn’t seem to work. The margins and paddings are still […]

Sliding menu locks touch event on upper view

I’m trying to use Sliding Menu in my application. On my Sony Xperia S it works very nice, but when I try to launch app on HTC Desire HD, menu opens perfect by gesture, but other touch events are blocked and top view (ViewPager, sliding menu is behind it) is not scrolling. Does anybody know […]

Weird issue refreshing ViewPager with new content:

I receive data from a web service that is parsed into an object in the Application class, this object which in my case is a Report class contains a list of Tabs that should populate the ViewPager. So this Report is stored in the currentReport parameter in the Application class. Each tab should be a […]

Android TabHost inside Fragment

I am working on an Android App and I have used android FragmentPager tabs example from developer.android.com), this example uses fragments for tabs contents, Now I want to place a tabHost inside one of those fragments, I have tried my best but the second tab hosts are not showing the content, I can see tab […]

RecyclerView ViewPager java.lang.NullPointerException android.support.v7.widget.RecyclerView$ItemAnimator$ItemHolderInfo.left

I am using ViewPager with the Recyclerview, but on the creating time it crashes… I was trying out AsyncListUtil with the Recyclerview.Adapter, and It worked. When I moved the fragment to the ViewPager it started crashing like this. Any insights ? FATAL EXCEPTION: main Process: com.dekanski.popularmovies, PID: 6554 java.lang.NullPointerException: Attempt to read from field ‘int […]

How to use Actionbar items with Viewpager + Fragments

Im trying to figure out how to implement Actionbar items based on the Fragment that is being loaded inside my viewpager. My code is below and im just trying to figure out the best practice for working with ABS + ViewPager + Fragments. MainActivity public class MainActivity extends SherlockFragmentActivity { private ViewPager mPager; private TitlePageIndicator […]

Tab+ViewPager not updating instead shows weird warning expected state 3 found 2

I have a mainactivity which includes a TabLayout with ViewPager I have added 3 tabs and each tab has separate fragments which contains a recyclerview, and these recyclerviews has a checkbox that should be simultaneously updated/refreshed whenever i swipe the viewpager(i save checked positions in shared preference and updates via shared preference). My problem here […]

Android: Should I add an empty constructor to a fragment used in ViewPager

I’m making a layout, similar to Google play’s. I’m using a ViewPager which requires fragments. I’m getting a little confused now because some sites say that a fragment requires an empty constructor, but the example on developer.android.com doesn’t contain a constructor. There code is just like this: public static class DemoObjectFragment extends Fragment { public […]

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