android-nested-fragment

FragmentManager popBackStack doesn't remove fragment

痴心易碎 提交于 2019-12-18 11:50:03
问题 I'm implementing menu navigation using Fragments. So I begin with Home, and then users can navigate to diferent sections and details of each section. When a user changes section, then I call pop on the fragmentmanager backstack until I reach Home, and then load the new section. This is all working as expected. But I'm getting this problem: load a section that calls setHasOptionsMenu(true) on onResume() loads another section (old section it's suposed to get out of the stack). I see it OK. No

getChildFragmentManager() and support libraries

那年仲夏 提交于 2019-12-18 03:17:09
问题 I am using the getChildFragmentManager() in an app that is compiling against API level 19, with the minimum SDK set to 14. getChildFragmentManager() was introduced in API 17, so devices running at API levels 14, 15, or 16 will throw a NoSuchMethodError when the method is called. I did look through all the other StackOverflow questions regarding this issue, but none of them seem to answer this question: is there any way to get the getChildFragmentManager() method to work on devices pre-API

Getting the error “Java.lang.IllegalStateException Activity has been destroyed” when using tabs with ViewPager

大憨熊 提交于 2019-12-18 02:57:30
问题 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 which holds a ViewPager element which in turn has some fragment pages. When I initially start the application the application, I am able to switch between tabs no problem but when I press on tab2 for the second time I get the error mentioned above. The main activity is as follows: public class

getParentFragment returning null

与世无争的帅哥 提交于 2019-12-17 16:24:56
问题 I have a Fragment that has a FrameLayout . This first fragment (A) loads inside its Framelayout another fragment (B). When I call getParentFragment from inner fragment (B), I get null . How should this method be used properly? 回答1: getParentFragment() was introduced in API level 17 (Android 4.2). Android 4.2 introduced the idea of nested fragments (fragments containing other fragments). Calling this results in null if the fragment has a parent which is an Activity. Have a look at this. If you

Best practice for nested fragments in Android 4.0, 4.1 (<4.2) without using the support library

我的未来我决定 提交于 2019-12-17 03:22:24
问题 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 and <= 4.1 The app has a multi-pane layout (two fragments, one small on the left, one content fragment on the right) and an action bar with tabs. Similar to this: Clicking a tab on the action bar changes the 'outer' fragment, and the inner fragment then is a fragment with two nested fragments (1.

Best practice for nested fragments in Android 4.0, 4.1 (<4.2) without using the support library

有些话、适合烂在心里 提交于 2019-12-17 03:22:15
问题 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 and <= 4.1 The app has a multi-pane layout (two fragments, one small on the left, one content fragment on the right) and an action bar with tabs. Similar to this: Clicking a tab on the action bar changes the 'outer' fragment, and the inner fragment then is a fragment with two nested fragments (1.

Display fragment viewpager within a fragment

我是研究僧i 提交于 2019-12-17 02:33:45
问题 I have a fragment which contains a ViewPager. The ViewPager is associated with an adapter that contains a set of fragments. Upon loading the parent fragment, I am met with an IllegalStateException with the message: java.lang.IllegalStateException: Recursive entry to executePendingTransactions . Some research has led me to the conclusion that the system is unable display fragments within another fragment, HOWEVER there seems to be some indication that it is possible to do exactly this with the

ViewPager : Navigating Back to Parent Fragment From Child Fragment Closes The Application

别说谁变了你拦得住时间么 提交于 2019-12-13 07:09:35
问题 I am implementing nested fragments in a ViewPager . When I perform the transaction by replacing the child fragment in the parent fragment after executing addToBackStack() , I am able to see the view shown below. But when I press back button and the code reaches the MainActivity 's onBackPressed() method, I notice the stack size is 1, and I successfully popout the Fragment . The problem starts now My app closes and for a brief amount of time, I see my child fragment closing and then the app

Eclipse Android missing getSupportFragmentManager and getChildFragmentManager

两盒软妹~` 提交于 2019-12-13 06:02:33
问题 Hi I tried using the android supported lib v4 as well as v13 instead of android app lib but eclipse still cannot recognize the getSupportedFragmentManager and getChildFragmentManager functions. Are there any steps I need to take in order fro eclipse to recognize both functions? Currently using Eclipse luna with latest android sdk, targeting api 17 platform. I need either function to see why the app crashes with no view found for id ?? when using viewpager inside dialogfragment. Thanks in

Commiting FragmentTransaction in 1 Tab of a FragmentPagerAdapter

折月煮酒 提交于 2019-12-13 02:26:16
问题 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 change replace works perfectly if I add the ListFragment to a FrameLayout inside an Activity , but I'm not sure how to do this using FragmentPagerAdapter . Here's a better explanation: Tab1 Tab2 Tab3 Tab4 fragment fragment fragment fragment subclass subclass subclass listview after clicking on one