Questions tagged [android-nested-fragment]

Nested android fragments represent fragments which are embedded in other fragments.

Nested fragments were introduced in the Android SDK starting with API level 4.2. They are also available on lower API versions through the support compatibility package.

By using getChildFragmentManager()(method of the Fragment class), a fragment can have the behavior of a FragmentActivity. The nested fragments workflow closely follows the one of a normal fragment(which is embedded at in an Activity). For more information about fragments, see the Google Documentaton.

When asking questions about nested fragments one should always add the tag, optionally the could also be added.

281 questions
0
votes
3 answers

Button onClick method never called inside Fragment

I'm using a fragment to show a GridView with some images and a Button to add new Images. The GridView works fine, but my Button's onClick method is never called. This is my Fragment's onCreateView method: public View onCreateView(LayoutInflater…
0
votes
1 answer

Issue with BackStack method and ViewPager in android

I have an activity which contains a framelayout. In it, I have a fragment which contains the ViewPager with two different fragments inside. When I push the button in the given fragment, I replace the framelayout container with a new fragment. Now…
0
votes
2 answers

ClassNotFoundException in nested fragments built by Maven

I have a problem with nested fragments: I have a parent fragment which I use to make a tab for action bar and SupportMapFragment to display a map in it, but if I build my project with Maven, I get this error: Caused by:…
0
votes
3 answers

Android Fragments NullPointerException error

I'm trying to use the following code to open a Fragment that is inside another Fragment but is gives me a Null Pointer Exception with no cause. Fragment newFragment = new SecondFragment(); // consider using Java coding conventions (upper char class…
0
votes
2 answers

Possible to retain state of child fragment when navigating back from another activity?

I have an activity that hosts a fragment A. When fragment A is attached, I add a child Fragment B or C (depending on some flag) to a container in the A fragment. Now if I navigate forward to a new activity and then hit the back button, the…
0
votes
1 answer

ViewPager doesnt show images in more than 1 Fragment

My app is a news app, with news listing fragment, NewsDetailsFragment (which contains menu, search, etc). I am using the single activity model and each screen is represented by a Fragment. NewsDetailsFragment includes a ViewPager (gallery). When I…
0
votes
1 answer

Android: FragmentPagerAdapter which includes multiple Fragments in same page

I have been looking for this all day. And I've have read through the Android Developer references aswell. I would like the following structure in my xml. The following LinearLayout…
0
votes
1 answer

Nested Fragments, is it necessary to use support lib v4 even though I want to program for >13

I decided to make my app compatible with api level 13 and higher, so I can remove all the support libs and start using fragmentManager instead of supportFragmentManager etc. However, now I realized that nested fragments (-->…
jpm
  • 3,300
  • 1
  • 19
  • 29
0
votes
1 answer

Adding a Tab with Fragments inside a Tab Fragment

I know my questions sounds like a tongue twister. Anyway I wanted to implement it but I don't have any idea on how to do it. I already know on how to use a FragmentActivity and add the TabHost for it but now what I have is a fragment that should…
KaHeL
  • 4,301
  • 16
  • 54
  • 78
0
votes
1 answer

No view found for ID xxx for fragment (nested fragments)

I have an activity that has a ViewPager in the layout. I have two fragments which display, one for each tab. One of the fragments is designed to host other fragments - this is the CustomerMainFragment which inflates fragment_customer_main:
cjk
  • 45,739
  • 9
  • 81
  • 112
0
votes
2 answers

Nested google map 2.0 fragment shows static picture

I have a problem with displaying google map fragment in view pager. I have an activity, viewpager in it, and in one of the fragments in viewpager there is a google map 2.0 fragment. Fragment layout:
0
votes
1 answer

Fragment visible every second view in Viewpager

I'm currently trying to include 2 Fragments inside a Viewpager Fragment. All works fine, but if I scroll 2 Fragments further and return to the one with the two fragments only the upper one is visible(Fragment B is invisible). If i do this again both…
0
votes
1 answer

Replace a Fragment with a Layout containing a Fragment

What I'm trying to do is have a master/detail style app where one of my selector options is a Google Map with some extra buttons below the map layout. All my other options just load a Fragment into a FrameLayout, using something…
Mike T
  • 4,747
  • 4
  • 32
  • 52
0
votes
1 answer

ViewPager with SherlockFragment always empty

Currently I have a tab host activity that contains SherlockFragment. In one of these tabs (Fragments), I want to implement a ViewPager that will show images (ImageView). I created a FragmentPagerAdapter and Fragment to add it in the ViewPager. But…
0
votes
1 answer

android.view.InflateException: Error inflating class fragment

I got the following error: 02-13 12:37:05.015: E/AndroidRuntime(8766): FATAL EXCEPTION: main 02-13 12:37:05.015: E/AndroidRuntime(8766): android.view.InflateException: Binary XML file line #9: Error inflating class fragment 02-13 12:37:05.015:…
1 2 3
18
19