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
2
votes
1 answer

Unable to remove Nested fragment completely from Main Fragment

In my activity, I have various fragments. By default activity displays a map. On listitem click, fragment A, B or C is displayed using following code: protected void replaceFragment(int i) { FragmentManager fragmentManager =…
GAMA
  • 5,958
  • 14
  • 79
  • 126
2
votes
1 answer

Access textfield of nested fragment

I have several fragments. Some fragments have the same buttons at the top and the bottom of the fragment, but the content is different. Therefore I'm using nested fragments for the top and the buttom part. This is my java class: LogFragment.java. I…
Maddy
  • 570
  • 1
  • 7
  • 27
2
votes
1 answer

How to properly handle MaskedWallet response in nested fragments

This is an example app to demo a problem with nested fragments and wallet https://github.com/zumper/WalletTest Here is the structure of the app in terms of nesting MainActivity | +-> TopLevelFragment | +->…
danb
  • 10,239
  • 14
  • 60
  • 76
2
votes
0 answers

Viewpager - setCurrentItem(1), the fragment parent fragment doesn't get onActivityResult() when child fragment calls startActivityForResult

So I have a nested Fragment and view pager scenario. I have an activity that loads ParentFragment. ParentFragment has a ViewPager that has 4 fragments. Normally the view pager starts at 0. But because I want to help the user return back to their…
2
votes
1 answer

ViewPager not drawing later fragments

I am using a ViewPager to create a UI where the user swipes between pages of grid like cells, each containing a news story. The first page is a 'Header' fragment, it has one much larger cell for the featured story. The rest are 'Standard' fragments…
2
votes
1 answer

Youtube api +fragments

Hello I have created a simple app with a MainActivity extending ActionBarActivity. I have 4 tab Fragments and the action bar is linked with those 4. Now inside one of those tabs I want to include a YouTube video player. I am struggling because I…
2
votes
0 answers

How to design an Auto-Nested Fragment Class

I'm trying to do something like this: public class MyFancyFragment extends Fragment { ... @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ... …
jdowdell
  • 1,578
  • 12
  • 24
2
votes
0 answers

Problems with Listview in ViewPager

I already managed to implement a ViewPager inside a fragment, filled with listviews on each tab. If you click on an item from one of the listviews, a new fragment should fill the whole screen to show some details of the selected item. The problem…
2
votes
1 answer

ViewPager within a DialogFragment does not change tabs onClick

I have created a popup DialogFragment with a ViewPager containing 3 tabs. I am able to swipe between these tabs, although I also want to be able to click on the tab headers to change between these tabs. Does anybody know if this is possible? I have…
2
votes
1 answer

Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://com.android.contacts/contacts/lookup...}}

I am trying to select a contact from contact list and add it to database. But, whenever i select the contact and process data in onActivityResult it throws this exception : java.lang.RuntimeException: Failure delivering result ResultInfo{who=null,…
2
votes
1 answer

TabHost inside Fragment when select an item in slide menu

My project allows user can use slide menu function (on the left). On slide menu, user can select 4 items: Zero, One, Two, and Three. My project has action bar. When user clicked Zero item, a screen is displayed. When user clicked One, Two, Three,…
2
votes
2 answers

ViewPager do not generate UI once the phone's back button is pressed

This is my code: Home.java import android.os.Bundle; import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import…
2
votes
1 answer

Navigation Drawer + ViewPager + Fragments, ViewPager doesn't destroy nested fragments

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 open navigation drawer and I select "item 1"…
2
votes
1 answer

SherlockFragment which contains SupportMapFragment does not open second time

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 when I goto other fragment and then again try to…
2
votes
2 answers

Unable to use getChildFragmentManager() in a fragment that was added to ViewPager

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 fragment for each page of the ViewPager but I want to…