FAQ Database Discussion Community


Loading Android Google Map fragment managed by ViewPager

android,google-maps,android-fragments,fragmentpageradapter
I can load a google map into an Android fragment that's within an activity. That has been working fine. But now I want to use ViewPager to navigate between views (class android.support.v4.app.Fragment). It doesn't seem possible to load a com.google.android.gms.maps.MapFragment into such a fragment. For example, in: import android.os.Bundle; import...

android disable fragment 0 in fragmentpager

java,android,android-fragments,fragmentpageradapter
I'd like to be able to not allow switching to one of my 3 fragments in my custom FragmentPagerAdapter when certain conditions are met. Unfortunately I failed to find any help. I'd prefer to not remove and re-add the fragment (item 0), as this criterium can change inside the FragmentActivity...

Cannot instate the type PagerAdapter? What's wrong?

android,android-activity,fragment,fragmentpageradapter
Hey guys I'm trying to swipe between my activities using PagerAdapter but I'm getting error here's my code, I'm a little new to development of Android, so I'm unable to understand the problem where I've found the solution on Internet. Can anybody tell me how to exactly fix it? Any...

java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.support.v4.app.Fragment

android-fragments,tabs,classcastexception,fragmentpageradapter,pagerslidingtabstrip
I get this error java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.support.v4.app.Fragment when I try to open my activity CuteCollection.java in my app. The strange part is that when I click on the first line (FragmentPagerAdapter.java:122) in the logcat error, it shows me a line from a file in the v4.support...

ViewPager refreshing itself

android,android-viewpager,fragmentpageradapter
Am running in some weird problem. I have implemented ViewPagerTabStrip by following the tutorial Here It's working fine and i have implemented Three Tabs. On the first Page /tab , i am loading the data from server & displaying it in the ListView The problem is, when i swipe to...

How to avoid calling 'onCreated()' method of near tabs when i switch to some tabs?

android,eclipse,tabs,fragmentpageradapter
i'm working on application in eclipse that have 5 tab and i have spent much time for that but now i have a big problem : when one of tabs is activated the next tab and prev tab is loading too and onCreated() method is called but i don't need...

Android RecyclerView with Fragments

android,android-viewpager,recyclerview,fragmentpageradapter
I have a ViewPager with a FragmentPagerAdapter. My customer wants me to switch from ViewPager to list; a vertical list with all the fragments. There can be a lot of fragments, so adding them all in a ScrollView is out of the question. Can I somehow do this while still...

Passing values between Fragments in FragmentPagerAdapter

android,fragment,fragmentpageradapter
In FragmentPageradapter I have 3 fragments. In first two fragments there is a SeekBar. When either of the SeekBar changes its value in fragment1, I want to change the value ofSeekBar which is inside fragment2. How can I achieve It?

add/remove fragment in viewpager using FragmentPagerAdapter

android,android-fragments,android-viewpager,fragmentpageradapter
I'm using FragmentPagerAdapter to load 4 fragments initially. Now i have another fragment which i want to show only when a click is performed (let say from a button inside other fragments) , and every time that fragment is bring to front, new data of should be in it. So...

how to implement refresh listview and bring new items in list if it reach end of list

android,listview,pull-to-refresh,fragmentpageradapter
I do not know how to implement refreshing listview and adding new items to list if it reach end of list in my parent fragment. I think I should explain my fragments structure first, because I found some tutorials and even libraries on githup but could not use them. The...

android.support.v4.app.FragmentPagerAdapter cannot be applied to android.app.FragmentManager

java,android,fragment,android-tabs,fragmentpageradapter
I want to implement just 2 fixed tabs in my application. I followed this tutorial. In my TabPagerAdapter class I'm getting this error : FragmentPageAdapter in android.support.v4.app.FragmentPagerAdapter cannot be applied to android.app.FragmentManager TabPageAdapter class: package com.nikhil.tabs; import android.app.Fragment; import android.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; public class TabsPagerAdapter extends FragmentPagerAdapter { public TabsPagerAdapter(FragmentManager...

RecyclerView in FragmentPagerAdaper only updates when screen is rotated

android,android-fragments,recyclerview,fragmentpageradapter
I have a fragment in a FragmentPagerAdpater. The Fragment is basically a RecyclerView. The source for the RecyclerView is provided by a Loader which is inside the Fragment. My problem is that the list appears empty when it is first instantiated. But when I rotate the screen, it appears fine....

One Fragment inside ViewPager doesn't show up

android,android-viewpager,fragment,fragmentpageradapter
I have a Tabbed Activity hosting a viewpager (auto-generated with eclipse wizard). I slightly modified just the auto generated FragmentPagerAdapter in order to instantiate a specific fragment on each tab. Initially i had 4 tab, 3 fragments for the first tabs and still the auto generated placeholder in the last...

Fragment interaction listeners in FragmentPagers

android,android-fragments,android-activity,android-viewpager,fragmentpageradapter
I am creating a tabbed application using a FragmentPagerAdapter and android.support.v4.view.ViewPager. In order to follow best practices and separation of concerns I have separated my app into several different fragments. Each of the fragments has an interaction listener that requires an Activity to subscribe to. Since I only have one...