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
1
vote
0 answers

Android Fragment overlapping each other and showing transparent view

I have an activity with a fragment container layout and in that layout i load a fragment A which has a listview (listview loads data from web). Now on clicking listview item i want to show detail view. For that i am loading another fragment B which…
Nouman Bhatti
  • 1,777
  • 4
  • 28
  • 55
1
vote
1 answer

RuntimeException in one case. NullExeption - getBackStackCount()

Only when my app was off (freed resourses for other apps) and when i again opened it, i got this exaption. If i myself closed app, all it worked. 11-10 22:00:10.007 6255-6255/com.john.testOne E/AndroidRuntime: FATAL EXCEPTION: main 11-10…
one_man
  • 135
  • 2
  • 14
1
vote
0 answers

How to properly clear the whole backstack ( without popping to the top element )?

Using android, I was wondering if it was a proper and clean way to clear the whole backstack? I found many answers on SO for that but they all make me pop to the top element. What I need is just a simple way to clean the backstack in order to keep…
Virthuss
  • 3,142
  • 1
  • 21
  • 39
1
vote
1 answer

How to add tag to Fragment Transaction?

I'm adding a Fragment to my Activity like this: getSupportFragmentManager() .beginTransaction() .add(R.id.frame_container, fragment) .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) …
Yuriy Kolbasinskiy
  • 3,791
  • 3
  • 16
  • 33
1
vote
1 answer

fragment transaction back stack not working?

So my main activity contains two fragments. With in the activity_main.xml layout file I have one (List)fragment and then a frame layout which will act as a container for the second fragment. Each time an item is clicked on the list fragments list…
RamanSB
  • 1,162
  • 9
  • 26
1
vote
0 answers

How to properly clear the Fragment BackStack?

I have an app that has a single activity where all the screens are displayed as fragments. So when most of the times I am changing the fragment I add it to the back stack. So the BackStack can get quite…
1
vote
0 answers

Fragment backStack not working desirably

In my app i have a navigation drawer.The HomeActivity holds the navigation drawer.In HomeActivity i am calling a fragment say A.I want this fragment to remain in the backstack.Then when the users selects any other options from the navigation menu…
Archana Vetkar
  • 63
  • 2
  • 11
1
vote
1 answer

How to handle backstack for replacing the same fragment with different data

In order to navigate between fragments within 1 activity, I implemented a method called fragmentSwicher, that gets a fragment and replaces it with activated fragment in container. So far so good, but now the problem is I want to re-use a fragment…
Ali Abdolahi
  • 324
  • 3
  • 10
1
vote
1 answer

How to replace only the item at the top of a fragment back stack with another fragment?

When I perform getSupportFragmentManager().popBackStack(); it pops the back stack and performs the fragment transaction associated with the popped back stack entry. I have 3 fragment: - FragmentA - FragmentB - FragmentC My activity performs 3…
1
vote
2 answers

Android BackStack issue

I am having trouble fixing a problem that I have with the BackStack. I have 3 fragments that are managed by an Activity: The navigation between the fragments I using this code: private void showFragment(BabysitFragment babysitFragment, UserRequest…
Jdruwe
  • 3,450
  • 6
  • 36
  • 57
1
vote
1 answer

how to avoid creating the loop with the fragment backstack

I am trying to navigate between fragments like below: Fragment A --> Fragment B --> Fragment C --> Fragment D and the user can again navigate from Fragment D --> Fragment A like below: Fragment D --> Fragment A --> Fragment B --> Fragment C -->…
Pravesh
  • 822
  • 1
  • 8
  • 20
1
vote
3 answers

Query with Fragment backstack

Say I have 2 fragments: A and B Fragment A is on top. Now, I add fragment B keeping A in backstack. Now when back button is pressed, B is removed and A comes on top. Is there any callback method in A which gets called at this point? Note: onResume…
seema
  • 991
  • 1
  • 13
  • 27
1
vote
0 answers

Android backstack is not working with multiple fragments in same activity

First of all many thanks for all those are supporting newbies like me. I am creating an application in which I've following scenario:- I've HomeScreenActivity which have gridview that represents categories. When i press on any grid item then a…
1
vote
1 answer

Android fragment backstack animation fail after orientation change

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…
1
vote
1 answer

Cyclic fragment backstack

I have 5 fragments in my app. I use backstack. When I open fragment, he added to backstack. [Fragment1]->[Fragment2]->[Fragment3]->[Fragment4]->[Fragment5] And when I click back-button I need to open 2 latest fragmets…
Vladimir
  • 25
  • 7