Questions tagged [fragment-backstack]

Akin to the Android Activity backstack, the Fragment backstack is a task-like stack of Fragments (specified when adding a Fragment to a page with FragmentManager). It allows a linear navigation backwards from the current visible fragment, back through a history of previous fragments in a container until you reach the base fragment.

Akin to the Android Activity backstack, the Fragment backstack is a task-like stack of Fragments (specified when adding a Fragment to a page with FragmentManager). It allows a linear navigation backwards from the current visible fragment, back through a history of previous fragments in a container until you reach the base fragment.

Links

357 questions
0
votes
2 answers

Android Activity from Notification - FragmentManager backstack is zero

I searched around but couldn't find an answer. My app is based on fragments, and MainActivity is the entry point. When the user clicks on a notification, I trigger the desired behaviour with a PendingIntent that contains specific flags as to what…
0
votes
1 answer

Simulate backstack savedInstanceState behaviour

I want to test the state of my app when it's left in the backstack for too long. When I open like 20 apps one after the other my last used app (which is the app I'm testing) eventually terminates and a savedInstanceState occurs. Is there a way to…
ThanosFisherman
  • 5,626
  • 12
  • 38
  • 63
0
votes
1 answer

Strange Fragments backstack behavior

I faced app with one activity and all navigation based on Fragments. I have one place containing next steps: fragment1 replaced in container id1; I use add for add fragment2 to the same id1 container; after I use replace for add fragment3 to the…
busylee
  • 2,540
  • 1
  • 16
  • 35
0
votes
2 answers

Fragments and backstage sometimes get messed up

I have an activity with a container for fragments and a NavigationDrawer. If I select an item in the drawer, I call updatePage(index). I also call updatePage(0) if I create the activity and the savedInstanceState == null to init my activity. One…
prom85
  • 16,896
  • 17
  • 122
  • 242
0
votes
1 answer

Handling the backstack with fragments containing tabs

I'm trying to create an Android application which contains a single activity with a container and a navigation drawer. The initialy empty container loads fragments which has a ViewPager inside a tab layout in which I load a frgment with a…
0
votes
3 answers

Navigate via back-button from child fragment back to parent activity

I have a main activity and 2 fragments. In my main activity I have navigation drawer that navigates through the fragments. I handle the back button pressed like this: @Override public void onBackPressed() { if…
0
votes
2 answers

Hide all Fragments in Backstack but still being able to go back

I have a small layout in my activity that I add Fragments to based on the User navigating through the app. Assuming the user navigates thusly: Activity -> Fragment A -> Fragment B -> Fragment C -> Button Click I would like to be able to to hide the…
0
votes
1 answer

Android ViewPager Fragment - maintaining state

I have a ViewPager backed by a FragmentStatePagerAdapter. The app is a single Activity app, with fragments for each "page". Currently I'm using the ViewPager to display Categories of Products, and each Category will contain a ListView (or…
0
votes
2 answers

Updating navigation drawer after back press

I'm implementing an Android application with a Navigation Drawer and I have a problem with it. I started from the template (Android app with navigation drawer) in Android studio and added a new section to it - Settings. When clicking the settings…
Joakim
  • 3,224
  • 3
  • 29
  • 53
0
votes
2 answers

BackStack broken when using ActionBarActivity & getSupportFragmentManager

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…
0
votes
1 answer

Preloading a fragment when popBackStack

I have a problem with the backstack behaviour. That is what I am doing: add(fragment1) + addToBackStack(null) replace(fragment2) + addToBackStack(null) What is happening: Fragment 1 is added and in the backstack Then the second fragment replaces…
droidpl
  • 5,872
  • 4
  • 35
  • 47
0
votes
0 answers

Can't see added fragment on back button press

I have an activity. When it starts it loads Fragment A in onCreate using replace. This is not added to the back stack. I then want Fragment B, an overlay, to be added on top of the previous fragment. This is because i still want you to still be able…
0
votes
0 answers

Back Stack not working as expected

I have Activity A and B, both inherits from a BaseActivity class. Activity A handles several fragments, and from one of them Activity B is started. In the onCreate method of Activiy B I call the following method…
0
votes
2 answers

right way to make fragment transacrtion

I am developing android application with one activity and multiple fragments. My app contains navigation drawer. It's layout contains listview. Clicking it's items I change fragments dynamically with ft.replace(R.id.my_placehodler, new MyFragment())…
0
votes
1 answer

Up caret shows navigation drawer

Nothing much more to say. I'm using a single activity and I go into a Fragment which calls setDisplayHomeAsUpEnabled(Boolean.TRUE) and setHasOptionsMenu(Boolean.TRUE). The menu has two items and the interactions with them are right. I have set…
1 2 3
23
24