Questions tagged [back-stack]

"Back stack" is a stack in which activities within an Android task are arranged. Android task is a collection of activities that users interact with when performing a certain job. Through this process activities are placed on the stack, in the order in which each activity is opened. Activities can be accessed later in reverse order by pressing the "back" button.

658 questions
-1
votes
1 answer

Starting from activity B, how can I go back to activity A without killing B so that I can go back to B without creating it agan?

Is it possible to go back from Activity B to Activity A without killing Activity B so that you can go back to B again without creating a new one?
124697
  • 22,097
  • 68
  • 188
  • 315
-1
votes
3 answers

Clearing task and navigate to main activity upon clicking notification

I have the following scenario which I am trying to fix: Application consists of two activities, Activity_A and Activity_B Currently the user is located in Activity_B Notification received which leads to Activity_A HOWEVER When hitting the back key…
-1
votes
4 answers

Save button removes activity

I have an activity which has various settings the user can choose. There's a 'Save Settings' button on the activity and when pressed saves the user settings. At the moment, once saved the user then has to press the back button to take them back to…
Mint_Sauce
  • 55
  • 1
  • 11
-1
votes
5 answers

Handle ToggleButton in onResume()

I have written a program in which I am using Timer and controlling that timer using Toggle states. Toggle's default state is OFF, once I make changes in toggle state from OFF to ON Timer starts, and when I again change to OFF it stops the Timer as…
-1
votes
3 answers

DialogFragment shows onBack button press even if I remove it

I have used the following codes for showing and canceling dialogfragment : public static void showDialogFragment(FragmentManager fm,String type){ FragmentTransaction ft = fm.beginTransaction(); MyDialogFragment prev =…
mmlooloo
  • 18,937
  • 5
  • 45
  • 64
-1
votes
1 answer

android pop all activities and put selected activity on top of starting activity

I have couple of activities , let say A, B, C, D, E , Where A is the starting activity . On all the activities I have a navigation drawer with tabs to start these activities. The type of behavior I m planning is that no matter where the user is he…
Vihaan Verma
  • 12,815
  • 19
  • 97
  • 126
-2
votes
1 answer

In android device When I click back button till go back to home screen why the app is not removed from recent?

I found from google Docsenter link description here If the user continues to press Back, then each activity in the stack is popped off to reveal the previous one, until the user returns to the Home screen (or to whichever activity was running…
saibaba vali
  • 2,641
  • 1
  • 17
  • 17
-2
votes
1 answer

Close the currrent fragment and open the previous one

Imagine i have a frameLayout in my main activity, and two fragments, so now first fragment is being displayed, i replaced it with secondFragment and added first one to back stack, now some condition is met in the secondfragment so i want to close…
Femn Dharamshi
  • 527
  • 1
  • 9
  • 25
-2
votes
3 answers

Android Library back button

There is a android library. workflow like that: A1->A2-A3->Library activity->A3 I need to hide library activity when user click physical back button. Also, the library activity saved some data, so that I cannot destroy or finish() the library…
-2
votes
2 answers

Remove a FAB when a Fragment goes to backstack

I have seen a lot of answers but doesn't seems to find one. I am using new FAB in one of my fragments and want to remove it when that particular fragment goes to backstack, but I am not sure which method in fragment gets called when it is added to…
Ravi
  • 960
  • 1
  • 18
  • 41
-3
votes
1 answer

How to avoid fragment recreation using navigation architecture component?

I have 4 fragments in a drawer, lets call them fragment A, B, C, D. I use navigation architecture to bind my fragments with the drawer. Fragment A is my entry point and from there I can navigate anywhere on the drawer. Suppose I take the path A > B…
-3
votes
1 answer

How to keep edittexts values after calling another activity than back

I have Activity A with some edittexts and a button.After user populates edittextsin Activity A.Click the button than calling Activity B ( Listview). User click on listitem and come to back Activity A. My problem is when i come back to Activity A…
Keikoman
  • 73
  • 8
-3
votes
1 answer

backstack in fragments not working

In My MainActivity, I am adding three tabs named FragmentA, FragmentB and FragmentC. In FragmentA tab, i am populating a list of contacts via list fragment and adding this fragment to backstack. Now when i click on any of list item, it displays the…
1 2 3
43
44