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
4
votes
1 answer

Build fragment backStack for push notification

I am using FCM to show a fragment when user tap on the notification from the status bar. Current app flow is this MainActivity(Fragment A -> Fragment B -> Fragment C). However when user tap a notification (whether app is running or not), I want to…
4
votes
2 answers

Poping the backstack without causing illegalStateException

I was getting java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState in my code and i searched statckoverflow i got the below code as solution. Now i am not getting IllegalStateException but the problem is.. below…
kumar
  • 708
  • 4
  • 15
  • 39
4
votes
0 answers

popbackstackimmediate illegalstateexception Fragment already added

I was just playing around with below code. I have 3 frags and 3 buttons. I am calling this method on each button press. when I follow below sequence It crashes giving FragmentA already added error A->B->C-> A->B->C-> A->B(crash while exicuting…
Tushar
  • 1,122
  • 1
  • 13
  • 28
4
votes
1 answer

Skip fragments onBackPressed (add/hide)

I am using fragmentTransaction to proceed through fragments, it looks like this: FragmentManager fm = oldFragment.getFragmentManager(); FragmentTransaction fragmentTransaction = fm.beginTransaction(); …
4
votes
2 answers

Android Fragments - remove fragment from back stack if already exists

I have some fragments which will be replaced by following method. I think there's something wrong with my code because I want to prevent from adding multiple times a fragment into the back stack. If I click on fragment B twice, all instances will be…
Alex
  • 1,623
  • 1
  • 24
  • 48
4
votes
0 answers

Add two times a same fragment in the backstack?

Here is my problem. I'm basically working with a fragment containing some informations about a place, and a list of all the other places in the same city. By clicking on one of the element of the list, you can access an other instance of the same…
Virthuss
  • 3,142
  • 1
  • 21
  • 39
4
votes
2 answers

Fragment onResume() and backStack issue

I am stuck with situation for resuming my fragment when I am coming back from another fragment. Scenario : I have a Fragment A. Now I am opening multiple fragment with in Fragment A say : A1, A2, A3 ... using a frame layout. Now I am initiating a…
AndroidHacker
  • 3,596
  • 1
  • 25
  • 45
4
votes
1 answer

How to clear backStack of support FragmentManager?

Is there any way, how to clear backStack of support FragmentManager without calling onCreateView() in stored fragments? I understand fragment lyfe cycle and calling onDestroyView() and onCreateView() when it is…
4
votes
4 answers

Different backstack behavior between Nexus 6 device and emulator

I am working on an app that has a support Fragment with a SearchView widget and RecyclerView to present search results which sends the user to a FragmentActivity to display the details of the selection. All of this works fine, but I'm seeing…
TheIcemanCometh
  • 1,055
  • 2
  • 17
  • 31
4
votes
6 answers

Fragments BackStack. Fragments overlap even after pop.

The problem is to manage properly back stack so the previous fragment is poped out (or deleted). The problem is in their overlapping.. The structure of program as follows: sliding menu with 3 fragments for each section: CatalogFragment,…
AnZyuZya
  • 201
  • 1
  • 3
  • 18
4
votes
4 answers

Backstack android fragment navigation

This is how I used navigation drawer to display Fragments: private void displayView(int position) { // update the main content by replacing fragments Fragment fragment = null; switch (position) { …
coder
  • 13,002
  • 31
  • 112
  • 214
3
votes
1 answer

How do I pop android navigation backstack up to a certain fragment?

I am once again asking for your intellectual support. I have a fragment that puts a number of copies of itself on the navigation backstack like this: Navigation.findNavController(button).navigate( …
KalAnd
  • 81
  • 1
  • 7
3
votes
0 answers

Navigate to Existing Fragment Using NavController

I have a complicated structure where a number of Fragments link to each other, so using NavController I am trying to avoid creating multiple duplicates of the same Fragment in the BackStack. I found this post How to check Navigation Destination is…
Scamparelli
  • 756
  • 1
  • 12
  • 28
3
votes
2 answers

Previous fragment edittext focus issue

I am using multiple fragments. I am adding fragment over fragment as below supportfragmentmanager .beginTransaction() .add(R.id.container_login, newFragment, newFragment.javaClass.simpleName) …
Vir Rajpurohit
  • 1,869
  • 1
  • 10
  • 23
3
votes
3 answers

How to navigate between two activities using jetpack navigation library

I'm working on a simple app to test out JetPack Navigation in Android. My App have two activities "Activity1" and "Activity2". I'm aware that Jetpack navigation only works for SingleActivity apps but I want to see if there is any solution to my…
1 2
3
23 24