FAQ Database Discussion Community


Adroid backstack is null in onCreate method

java,android,android-fragments,fragment-backstack
I have two fragments in main Activity (1st fragment, 2nd fragment). I replace the 1st fragment with the container view in the onCreate method of main activity. In the 2nd fragment there is a ListView and when clicking an item on it, a new Activity starts as a detail. But...

Back navigation with Fragments / Toolbar

android,fragment,android-toolbar,android-actionbaractivity,fragment-backstack
I'm scratching my head with this one now.... I have an ActionBarActivity that loads an initial Fragment - the original menu is inflated within the activity. Now, I have a navigation bar that, when an item is selected, loads a different fragment and adds this to the backstack. When I...

PopBackStack but keep the first fragment in android

android,android-fragments,android-fragmentactivity,back-stack,fragment-backstack
I am working on fragment transaction, and the backstack is like this: fragA => fragB => fragC => fragD I would like to return to fragA after back fromn the fragD fragD => onBackPress => fragA So, I tried code like: getChildFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE); but it clear all the backstack ,...

Android fragment backstack animation fail after orientation change

android,animation,android-fragments,android-orientation,fragment-backstack
I have an activity which hosts two fragments with only one shown at a time. Effectively the user, through different environmental conditions, should be able to toggle between the two at any given time. There is a LoginFragment which is the first thing the user sees on login, and a...

BackStack broken when using ActionBarActivity & getSupportFragmentManager

android,android-fragments,android-actionbar,fragment-backstack
I have the following workflow in my application: Activity 1 (a ListView) -> Activity 2 (a ListView which loads Fragments) -> Fragment 1 -> Fragment 2. It all worked out beautifully, I could go forward to Fragment 2, then press the Back button to traverse backwards each step. At some...