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
3 answers

Fragment back stack, android?

My activity consists of navigation drawer and currently have 5 options in the left menu. Which all opens in fragment. I am looking for a way to keep a stack of all the fragments so when the user presses back button he moves to previous…
WISHY
  • 11,067
  • 25
  • 105
  • 197
1
vote
0 answers

Using backstack in android

I have an issue in fragment navigation in android. I am navigating from one fragment to another and from that fragment to another. When I press the back button, I need to navigate from the third fragment to first fragment. I need to avoid the second…
Sundeep
  • 375
  • 2
  • 4
  • 16
1
vote
1 answer

ListView in Fragment backstack still calling getView()

I have a Fragment which contains a ListView say FragmentA, when I add another Fragment which contains another ListView say FragmentB: getFragmentManager().beginTransaction() .add(R.id.fragment_container, FragmentB) .commit() I noticed that…
Andreas Wong
  • 59,630
  • 19
  • 106
  • 123
1
vote
1 answer

Fragment Navigation with Navigation Drawer

i actually have a little Problem with my Android App. My App Contains a Navigation Drawer which is used to navigate inside the App. For Example Navigation Drawer: Overview Search Users Stuff When the App starts, i will load the Overview…
1
vote
1 answer

how to remove menu from fragment back pressed android

I am developing a application that should support on both phone and tablet. In this application i am using fragments from android. Now the flow of the application is like MainActivity --> Fragment1 --> Fragment2 In this application , i want a menu…
1
vote
3 answers

How to Load fragment from BackStack in android

I have 4 buttons in a fragment. When I click one button 'A' a fragment is loaded. When click on button 'B' another fragment is loaded and so on. My problem is when again i clicked on the Button A new fragment is loading. I want to load the previous…
0
votes
0 answers

how to fix a toolbar bag (Android, kotlin)

I have problem with backstack and toolbar. I have a singchat fragment and a user overlay. When I switch from the singchat fragment to the user overlay, I disable the mToolbar that is passed to all fragments from MainActivity and use AppBarLayout…
0
votes
0 answers

Handling Back stack Navigation in Compose

I have a question regarding compose navigation. I have Activity A which is child to other activity. Activity A has a composable view to set to the content. Now from A have to navigate to a fragment B for which i use Navhost and add a composable…
0
votes
1 answer

Close Dialog from Activity open in Child Fragment in NavGraph

I want to close any dialog open from nav_graph on some event. NavHostActivity.kt xml
0
votes
1 answer

Android navigation drawer layout menu item fragments not getting added to back stack

I've got a bug that I think may be unsolvable. I'm not sure what I am doing wrong; and I suspect that perhaps I am not doing things in the correct, 'android' way. I have a single activity app with multiple fragments and a drawerlayout &…
0
votes
0 answers

How to manage backstacks in bottom navigation view kotlin

I am facing the issue like i created bottom navigation view fragments like homeFragment , listFragment, taskFragment and profileFragment and i add some button ,view, image in listFragment once we click the view or any button in listFragment i want…
0
votes
0 answers

when onBackPress happens in fragments app will close

I made some fragments and a nav_Graph and using setOnClickListener on some button and actions from nav_Graph to move between the fragments but when I press the back button it will close the app how can I fix that ? the nav_graph
0
votes
0 answers

Replacing fragment not working in Android and error is ' view not found '

I am trying to replace fragments on back press but unable to do so as error pops out " view not found " . I am using Drawer layout as my parent layout in MainActivity.xml as shown in image. Please help me with it. activity_main.xml
0
votes
1 answer

How to return to the last fragment after pressing home button or exit the android app?

when returning to the app after pressing home button or exit the app it returns to the first fragment of the app (splash screen) I need it to return to the last fragment before pressing home button, if I were on the home fragment and pressed the…
0
votes
2 answers

How to call a method in a Fragment when backstack change

I have 2 fragments FragmentA and FragmentB From FragmentA I open FragmentB val transaction = fragmentManager.beginTransaction() transaction.add(CONTAINER_VIEW_ID, FRAGMENT_B_INSTANCE,…