Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
4k views

My app has Navigation Drawer with two items: a ViewPager (inside a Fragment) and SupportMapFragment. ViewPager use a FragmentStatePagerAdapter and getItem(int position) return two Fragments. When I ...
Bae's user avatar
  • 912
19 votes
3 answers
8k views

I am having an issue getting the view to change on a tabhost - when I select a tab the content stays blank. From what I can tell, onCreateView is not being called on the child Fragments. onMenuCreate ...
shaneburgess's user avatar
1 vote
1 answer
2k views

When there is a need to use getSupportFragmentManager() to support lower API levels, I think using getChildFragmentManager() method. How this method supports all API levels?
saravanan's user avatar
  • 5,417
6 votes
2 answers
3k views

I have 4 fragments. I switch among them by using hide/show transactions. One of them may have nested fragments which are added by replace transaction. The issue is that if I add a nested fragment hide ...
Lingviston's user avatar
  • 5,721
0 votes
3 answers
1k views

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(); // ...
Luke Pring's user avatar
  • 1,002
0 votes
2 answers
889 views

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 ...
pat's user avatar
  • 1,015
0 votes
1 answer
314 views

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. ...
Mahmoud Badri's user avatar
0 votes
1 answer
490 views

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. <LinearLayout> <fragment /> ...
basickarl's user avatar
  • 41.2k
8 votes
2 answers
9k views

I am trying to create a ViewPager which contains 5 fragments. 5 fragments "container", so each of them contain 2 fragments. The 4 first fragments have the same layout and belong to the same class. ...
Seb83's user avatar
  • 236
0 votes
1 answer
150 views

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 ...
jpm's user avatar
  • 3,449
1 vote
3 answers
3k views

I have the same issue has this post: android.support.v4.app.Fragment: undefined method getChildFragmentManager(). I need to use getChildFragmentManager() because I'm using nested fragments. My ...
dasdasd's user avatar
  • 2,031
7 votes
1 answer
2k views

I'm developing an android app, with TabHost & FragmentActivity in each tab. In my first tab I initialize a fragment with a ViewPager indicator and a button, this button open a dialog with another ...
Ollie Strevel's user avatar
2 votes
1 answer
677 views

In my app there is one SherlockFragmentActivity, whick has 6 fragments. One of these fragments contains map-fragment. Problem : Now problem is when I launch an app the map loads successfully, but ...
Krunal Panchal's user avatar
56 votes
7 answers
95k views

I need to place a ViewPager inside of a fragment, but I have two fragments, Fragment 1 is my MENU, and Fragment 2 I want to use as a ViewPagerIndicator. But a fragment can't have another fragment... ...
Gilberto Ibarra's user avatar
1 vote
2 answers
421 views

I'm using FragmentPageAdapter to have multiple tabs within my app. 1 of those tabs is a ListFragment that is supposed to be replaced by another fragment onItemClick, using FragmentTransaction. The ...
Christopher Francisco's user avatar
12 votes
3 answers
32k views

Problem According to the Google's docs: You can now embed fragments inside fragments. This is useful for a variety of situations in which you want to place dynamic and re-usable UI components ...
AlexMomotov's user avatar
  • 7,478
2 votes
2 answers
8k views

I have an app that is using ActionbarSherlock, SlidingMenu, and also ViewPager. This app works well but I am trying to introduce using Nested Fragment into the ViewPager. Currently I have one ...
user1713455's user avatar
4 votes
1 answer
1k views

I am building android project with maven. But I found when I call getChildFragmentManager in v4.Fragment, it shows an error that this method is not found. I doubt that the support-v4 package is not ...
Frank Cheng's user avatar
  • 6,236
0 votes
1 answer
90 views

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 ...
KaHeL's user avatar
  • 4,379
9 votes
1 answer
4k views

I'm using DrawerLayout with ViewPagerIndicator, however the last won't work correctly with the DrawerLayout. Once I open the application, the viewpager is displayed correctly but once I change ...
user avatar
0 votes
1 answer
2k views

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 ...
cjk's user avatar
  • 46.6k
3 votes
2 answers
2k views

In my application there are several fragments in an activity and I am maintaining a backStack for these fragment. Everything is okay, but there is a nested fragment among them. When I put it into ...
Kaidul's user avatar
  • 16k
16 votes
2 answers
19k views

I would like to add a fragment to a dialog (it can be either a DialogFragment or a regular Dialog). How do I do that? Here's my DialogFragment: public class MyDialogFragment extends DialogFragment { ...
Kalisky's user avatar
  • 1,161
0 votes
2 answers
570 views

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: ...
G. Kh.'s user avatar
  • 306
6 votes
1 answer
3k views

I want to add a youtube fragment into my already existing fragments dynamically. The code I used is below: // setting the Youtube Player Dynamically private int setYoutubePlayer(String desc, ...
Mohamed Sabri Rauf's user avatar
1 vote
2 answers
4k views

I am trying to build a three pane layout (three ListFragment). I am able to create it inside an activity by following layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:...
Kaidul's user avatar
  • 16k
38 votes
1 answer
34k views

I have one main activity which is fragment activity here I am setting two tabs with two fragments A and B in the B fragment I have one button when the user click on the button I want to change ...
kalyan pvs's user avatar
  • 14.6k
1 vote
1 answer
344 views

I am trying to replace a Fragment inside another Fragment and I get a weird NullPointerException, could you please take a look and tell me what do you think? Here is my code: public class ...
Adrian Olar's user avatar
  • 2,913
3 votes
1 answer
2k views

From FragmentPagerAdapter in case 0 I instantiated fragment A this fragment I wanted to display display two fragments inside frag A. The view is not displaying. MyFragmentPagerAdapter is called by ...
rahstame's user avatar
  • 2,198
2 votes
2 answers
2k views

I have 3 fragment tabs, fragment1, fragment2, and fragment3. I have created another fragment tabs in fragment2. The problem is whenever I reselect fragment2 that contains fragment tabs, my app crashes ...
KC Chai's user avatar
  • 1,617
1 vote
3 answers
2k views

Googling I see many declarations that nested fragments cannot use XML. Now I am new to Android, but my app is using XML with nested fragments. I haven't got the listeners and interfaces working yet (...
user2383867's user avatar
4 votes
3 answers
6k views

I'm trying to put 2 fragments inside a fragment. I found some code on internet but, as far as I could go, I don't succeed to put 2 fragments in 1 fragment. I have seen tips dealing with ...
Arthur Allnc's user avatar
6 votes
2 answers
3k views

I need to use nested fragments for my application and so I'd like to use getChildFragmentManager. I have two devices: A real one running on 4.0.3 A virtual one running on 4.2.2 It works pretty well ...
nathan's user avatar
  • 1,119
0 votes
1 answer
281 views

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(...
LeDon's user avatar
  • 549
4 votes
0 answers
1k views

I have a viewpager inside fragment. I would like to use FragmentPagerAdapter to swipe between fragments inside my viewpager. public static class MyFragmentPagerAdapter extends FragmentPagerAdapter { ...
DixieFlatline's user avatar
0 votes
1 answer
488 views

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 ...
Mike T's user avatar
  • 4,795
1 vote
1 answer
758 views

I have a ViewPager contains three fragment, and I want to put 3 new fragments into the third fragment.Is that possible? [ViewPager] [Fragment 1] [Fragment 2] [Fragment 3] [...
thecr0w's user avatar
  • 2,207
2 votes
3 answers
4k views

I have an activity which makes use of a FragmentTabHost, so each tab has a fragment inside it. In the first tab, I have 2 nested fragments, one on the top half of the screen, the other on the bottom ...
KairisCharm's user avatar
  • 1,373
1 vote
1 answer
1k views

I have a viewpager in a fragment that works correctly on start up but if reload the fragment by replace() or replace with another fragment then load it again. The viewpager doesn't work correctly. I ...
user1634451's user avatar
  • 5,232
53 votes
3 answers
13k views

I'm trying to make an app that has a ViewPager in a Fragment that is part of a TabHost. Everything works out fine. I have my tabbar, I can switch tabs. When I switch to the tab with the ViewPager, all ...
Daan Olislagers's user avatar
13 votes
4 answers
14k views

Can anyone point me to an example or show me how to create a simple Tabbed Dialog in Android where the contents of each tab are Fragments? All the examples/tutorials I have found are about Fragments ...
Paul Drummond's user avatar
0 votes
1 answer
725 views

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 ...
Abuzaid's user avatar
  • 1,005
1 vote
1 answer
196 views

What I'm trying to accomplish is have my view refresh when someone comes back from the settings and changes their preference. I thought this would work but it is not. Any ideas on how i can accomplish ...
jcaruso's user avatar
  • 2,524
18 votes
4 answers
17k views

In my application, I use an Activity which holds one Fragment with FragmentTabHost and hence all its tabs are nested Fragments. Inside an Activity which holds a Fragment with its nested Fragment, we ...
Alex Bonel's user avatar
  • 1,444
2 votes
2 answers
13k views

I'm using ActionBarSherlock and ViewPageIndicator and I tried to implement nested fragments, but the method getChildFragmentManager() is undefined in myandroid.support.v4.app.Fragments. There are no ...
blub's user avatar
  • 9,235
115 votes
6 answers
76k views

I'm writing an app for 4.0 and 4.1 tablets, for which I do not want to use the support libraries (if not needed) but the 4.x api only therefore. So my target platform is very well defined as: >= 4.0 ...
Mathias Conradt's user avatar
5 votes
4 answers
13k views

I use Tabs ActionBar with Fragments. Inside one fragment I have button. I want to show a DialogFragment (inside my fragment) when the button is pressed. How can I do that? This is my code public ...
Ebtehal___'s user avatar
9 votes
1 answer
4k views

I'm really messed up with the android ViewPager's lifecycle, and I'm starting to think that there something wrong in the structure of my app. So I would like a confirmation if I can do the following : ...
NLemay's user avatar
  • 2,393
6 votes
2 answers
4k views

I have an app with hierarchy like this: FragmentTabHost (Main Activity) - Fragment (tab 1 content - splitter view) - Fragment (lhs, list) - Framment (rhs, content view) - Fragment (tab 2 ...
Brad Robinson's user avatar
113 votes
14 answers
117k views

I have an application that consists of using ActionBarSherlock in tab mode.I have 5 tabs and the content of each tab is handled using fragments. For tab2 though, I have a fragment the xml file of ...
Yulric Sequeira's user avatar