All Questions

163
votes
6answers
213297 views

How to implement a ViewPager with different Fragments / Layouts

When I start an activity which implements viewpager, the viewpager created various fragments. I want to use different layouts for each fragment, but the problem is that viewpager shows only two layout...
110
votes
11answers
71383 views

Remove Fragment Page from ViewPager in Android

I'm trying to dynamically add and remove Fragments from a ViewPager, adding works without any problems, but removing doesn't work as expected. Everytime I want to remove the current item, the last on...
265
votes
7answers
74457 views

Difference between FragmentPagerAdapter and FragmentStatePagerAdapter

What is the difference between FragmentPagerAdapter and FragmentStatePagerAdapter? About FragmentPagerAdapter Google's guide says: This version of the pager is best for use when there are a handf...
64
votes
12answers
52377 views

How to get existing fragments when using FragmentPagerAdapter

I have problem making my fragments communicating with each other through the Activity, which is using the FragmentPagerAdapter, as a helper class that implements the management of tabs and all details...
2
votes
1answers
11828 views

refresh fragment UI from fragmentActivity

I want to change a ImageView in fragment(that create in code), from FragmentActivity. (there is no fragment and tag in XML). MainActivity that extends from FragmentActivity and implements from Google...
26
votes
7answers
31325 views

IllegalStateException: The application's PagerAdapter changed the adapter's content without calling PagerAdapter#notifyDataSetChanged

I'm using the ViewPager example with ActionBar tabs taken from the Android documentation here. Unfortunately, as soon as I call the addTab method, the application crashes with the following exception...
0
votes
2answers
1532 views

Pager Adapter not displaying image after getting from response in fragment

I am getting three images from response,and i am storing in arraylist,then i try to set in PagerAdapter,but nothing display in my view pager,following is my pageradapter class,can any one tell that wh...
16
votes
3answers
44110 views

How do I use FragmentPagerAdapter to have tabs with different content?

I want to have different tabs, where you can swipe through like in the android market. Each tab should use one fragment and use one method for it. This is my FragmentPagerAdapter class: public class...
17
votes
2answers
11019 views

FragmentPagerAdapter - How to handle Orientation Changes?

I use a FragmentPagerAdapter containing several Fragments that need to be notified about changes to the database. I do this by iterating over the fragments, which implement a callback interface, and ...
48
votes
4answers
7744 views

Navigating back to FragmentPagerAdapter -> fragments are empty

I have a Fragment (I'll call it pagerFragment) that is added to the backstack and is visible. It holds a viewPager with a FragmentPagerAdapter. The FragmentPagerAdapter holds (let's say) two fragments...

Previous Next