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

Android - fragment back stack resulting into white screen

I have five different fragments in my project, let's call them A...E. A and B are only visible for the user when he opens the app. Those are responsible for showing the loading screen (checking current login session) and the login screen itself.…
Mordag
  • 487
  • 7
  • 20
0
votes
0 answers

how to cancel animation when popping backstack

Let's say I have a fragment transaction that, when originally executed, was set up with these animations: transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right, R.anim.slide_in_right, R.anim.slide_out_left); Usually, I…
Casey Perkins
  • 1,853
  • 2
  • 23
  • 41
0
votes
1 answer

Back Stack in fragments not working

I have a home activity in that I am replacing fragments as required. In home activity I have main fragment, then from main fragment I am replacing a Transport fragment, from Transport fragment I am replacing TransportList Fragment. Now as I press…
Sid
  • 2,792
  • 9
  • 55
  • 111
0
votes
0 answers

Clean up android back-stack fragment

I currently have an apps with 3 available fragments that replaced with bottom nav bar. Here's my method called when my navbar pressed: private void setFragment(int id, boolean first) { FragmentTransaction fragmentTransaction =…
user3576118
  • 375
  • 1
  • 5
  • 24
0
votes
3 answers

How to save List in onDestroyView in Fragment?

I am trying to implement Instagram-like user profile screen. This is my flow ProfileFragment --> SingleImageFragment --> ProfileFragment --> SingleImageFragment. So, the user can have multiple instances of the same fragment. I don't want to…
Esteban
  • 667
  • 9
  • 22
0
votes
0 answers

restore all the Fragments from backstack in Android

Assume: I have an Activity and I'm loading 3 fragments and also added them to Back Stack. Reality: I have more than 3 Fragments and they are loaded based on some condition and are not Fixed in some particular order. Initially 1 will be loaded then…
kevz
  • 2,727
  • 14
  • 39
0
votes
2 answers

Android restrict fragments only one time go to back stack

Hello guys I'm using BottomNavigationView. Each item of BottomNavigationView will open a fragment which will store in back-stack, But if a item selected multiple times back-stack will store latest instance of that fragment. I mean when pressing back…
Abhishek Singh
  • 9,008
  • 5
  • 28
  • 53
0
votes
1 answer

Find a proper way to remove search onbackpress fragment

I'm developing an application that involves fragments. There are three fragments Item List fragment Item details fragment Search/Loading fragment Everything works well until the user press onbackbutton. I would like to show the user the previous…
Anton Makov
  • 825
  • 2
  • 9
  • 25
0
votes
0 answers

Collapsing Toolbar not collapsing completely when restored in a fragment from backstack

The collapsing toolbar gets stuck in mid way, when i restore the fragment(containing the collapsing toolbar) from back stack. It is collapsing perfectly initially, but when i put the fragment in back-stack, move to next fragment and come back to…
0
votes
1 answer

HERE SDK MapFragment implementation using fragment container

is there anyone here that is using a fragment container to show the MapFragment at runtime? I have some issues with this implementation. If I replace the MapFragment with another FragmentActivity and popbackstack it. The Map view is not showing and…
0
votes
1 answer

Android fragment backstack (change ui on latest change same fragment)

I have 3 fragments. HomeFragment UserFragment ImagesFragment i use this method for add fragments: add(R.id.frameLayout, HomeFragment, "HomeFragment"); add(R.id.frameLayout, UserFragment, "UserFragment"); add(R.id.frameLayout, ImagesFragment,…
Farzad
  • 1,975
  • 1
  • 25
  • 47
0
votes
1 answer

Android: Fragments, popBackStack method goes too back

I learned that popBackStack method cancels the operation defined with the addToBackStack method. findViewById(R.id.button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { …
Curio
  • 1,331
  • 2
  • 14
  • 34
0
votes
0 answers

Android - How to co-ordinate Spinner and Fragments when going back?

I have a Spinner in my activity which works very simply: When the user selects an item in the spinner, the appropriate Fragment is shown in the activity by replacing the previously-shown fragment. My spinner uses a SimpleCursorAdapter. And each…
0
votes
2 answers

Remove fragments from backstack android?

I have total of 7 fragments Frag1 -> Frag2 -> Frag3 -> Frag4 -> Frag5 -> Frag6 -> Frag7 The user navigates from Frag1 -> Frag7 So, when the user is on Frag7 and presses the back button Frag1 should be visible. This is fragment transaction code …
WISHY
  • 11,067
  • 25
  • 105
  • 197
0
votes
2 answers

POP_BACK_STACK_INCLUSIVE cause to call onResume method of previous fragment

I have fragments say CompanyFragment,DashboardFragment,CalendarFragment. My default fragment is CompanyFragment. Expected Flow Should be Select Company from CompanyFragment Navigating to DashboardFragment Changing date from Dashboard so navigating…
Reena
  • 1,368
  • 1
  • 11
  • 25