android-nested-fragment

ViewPager setOffscreenPageLimit not working when using it as NestedFragment with getChildFragmentManager

为君一笑 提交于 2020-01-23 16:52:21
问题 I am trying to do something similar as https://stackoverflow.com/a/24437224/2277631. I am even using the same layout: I am following this approach because I am using a NavigationView (each option is a fragment) that has the first option as a fragment with Tabs (so a ViewPager with more fragments). I found a problem when using: viewPager.setAdapter(new AdapterView(getChildFragmentManager())); Basically, using the ViewPager as nested fragment, it only loads 1 page (from the 3 tabs), and it only

ViewPager setOffscreenPageLimit not working when using it as NestedFragment with getChildFragmentManager

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-23 16:51:07
问题 I am trying to do something similar as https://stackoverflow.com/a/24437224/2277631. I am even using the same layout: I am following this approach because I am using a NavigationView (each option is a fragment) that has the first option as a fragment with Tabs (so a ViewPager with more fragments). I found a problem when using: viewPager.setAdapter(new AdapterView(getChildFragmentManager())); Basically, using the ViewPager as nested fragment, it only loads 1 page (from the 3 tabs), and it only

Where is getChildFragmentManager in support library v13?

巧了我就是萌 提交于 2020-01-22 13:55:27
问题 Android support library v13 is supposed to provide support for newer APIs from Android 3.1. However, as far as I can tell there is no support for child fragments. Specifically, where is getChildFragmentManager()? The v13 support library relies on native fragments, which didn't add this method until API level 17. I have an app with minimum SDK level 14 so I should be able to use the v13 support library, but it seems I can't. I don't want to go all the way back to the v4 support library and

SupportMapFragment issue in nested TabHost Fragment

回眸只為那壹抹淺笑 提交于 2020-01-22 02:06:47
问题 I have 1 FragmentActivity 1 main fragment and 2 tabshosted child fragment one is for listview another for map. I have 2 problems here. First one is that I have to prevent recreation of child fragments on every tabchanges. Second problem; the first time I click tab for map fragment map can be seen. but coming back to list fragment and return to map fragment map is not being showed. I am really have trouble with this part in my project. I need your guide. My all code is as below. Main(Parent)

How to change the body of tab onClick of same tab in fragmentTabhost

余生颓废 提交于 2020-01-03 06:41:31
问题 What I am doing : I have a fragmentabhost in a fragment that has 3-tabs in it. On click of tabs i am able to change the fragments dynamically On click of first tab i am displaying RatingAscending.class What I am trying to do : Now Onclick of the same tab I want to display RatingDescending.class Note : in the onResume() I am able to detect click event for the firsttab Now how can I change the tab to RatingDescending.class from RatingAscending.class when I click the tab for the second time

Correct way to remove all (Child) fragments

只愿长相守 提交于 2020-01-01 17:09:08
问题 I load a bunch of Child fragments dynamically inside a Parent's Fragment linearLayout (fragmentContainer), then when user clicks a button, I need to remove them all and add new ones. I don't know the exact number of fragments that will be added each time. This is my way of removing all the fragments at once LinearLayout ll = (LinearLayout) view.findViewById(R.id.fragmentContainer); ll.removeAllViews(); Now I can add the new ones using fragment transaction methods. This way of removing all

Correct way to remove all (Child) fragments

馋奶兔 提交于 2020-01-01 17:08:29
问题 I load a bunch of Child fragments dynamically inside a Parent's Fragment linearLayout (fragmentContainer), then when user clicks a button, I need to remove them all and add new ones. I don't know the exact number of fragments that will be added each time. This is my way of removing all the fragments at once LinearLayout ll = (LinearLayout) view.findViewById(R.id.fragmentContainer); ll.removeAllViews(); Now I can add the new ones using fragment transaction methods. This way of removing all

Child fragment gets destroyed for no good reason

跟風遠走 提交于 2020-01-01 03:22:11
问题 Info: I have a 2 pane layout (2 child Fragments ) inside a ParentFragment , which, of course, is inside a FragmentActivity . I have setRetainInstance(true) on the ParentFragment . On orientation change, the left child fragment doesn't get destroyed ( onCreate() doesn't get called), which is normal (because of the parent retaining its instance). Problem: On orientation change, the right fragment gets destroyed ( onCreate() gets called). Why the hell is the right fragment destroyed and the left

Working with OptionsMenu in nested fragment not updating

吃可爱长大的小学妹 提交于 2019-12-25 09:18:53
问题 I displayed a fragment A that implements a ViewPager with several fragments (nested fragments). In my nested fragments, I inflate a menu with the following method. @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.my_menu, menu); super.onCreateOptionsMenu(menu, inflater); } This question was already asked here. And i tried all the answers its not working. My issue is Everything working fine.but when i open another fragment(it have not any

How to place a google map/code inside a viewpager

守給你的承諾、 提交于 2019-12-25 06:36:54
问题 Like the title says, I want to make a ViewPager which contains two sections: 1- a Listview (name of the places to go with PHP / MySQL / JSON) 2- and a GoogleMap with Markers depending of what you select in point 1 So, I have this code for a ListView and a second code for the GoogleMap with a location Button. I want to merge them in a ViewPager but I don't figure out how to make this possible. See my code below: google class: package com.bla; import com.google.android.gms.maps.GoogleMap;