Questions tagged [back-button]

A button that will take the user back to the previous state that they were on.

A back button, often depicted with leftward facing arrow icon, is a basic control that allows the user to return to a previous application state.

In web browsers, a historical record of each time a user navigates to a new page is kept. Clicking the browser's back button will return the user to the previous page in the history.


For example, if a user navigates first to google.com (1) then to facebook.com (2) then to youtube.com (3), their browsing history will include all the pages they visited at each site in the order they were viewed (1, 2, 3).

While on youtube.com (3), if the user clicks the back button, they will then be taken to facebook.com (2). If they click the back button again, they will be taken to google.com (1).

1630 questions
389
votes
48 answers

Clicking the back button twice to exit an activity

I've noticed this pattern in a lot of Android apps and games recently: when clicking the back button to "exit" the application, a Toast comes up with a message similar to "Please click BACK again to exit". I was wondering, as I'm seeing it more and…
Guillaume
  • 22,694
  • 14
  • 56
  • 70
285
votes
16 answers

flutter remove back button on appbar

I am wondering, if anyone knows of a way to remove the back button that shows up on the appBar in a flutter app when you use Navigator.pushNamed to go to another page. The reason I do not want it on this resulting page is that it is coming from the…
Robert
  • 5,347
  • 13
  • 40
  • 57
225
votes
10 answers

Android - How To Override the "Back" button so it doesn't Finish() my Activity?

I currently have an Activity that when it gets displayed a Notification will also get displayed in the Notification bar. This is so that when the User presses home and the Activity gets pushed to the background they can get back to the Activity via…
199
votes
22 answers

How to exit from the application and show the home screen?

I have an application where on the home page I have buttons for navigation through the application. On that page I have a button "EXIT" which when clicked should take the user to the home screen on the phone where the application icon is. How can I…
poojan9118
  • 2,373
  • 2
  • 17
  • 13
110
votes
12 answers

How do I detect if a user has got to a page using the back button?

This question is similar to Track when user hits back button on the browser, but not the same... I have a solution and am posting it here for reference and feedback. If anyone has any better options, I'm all ears! The situation is that I have a…
Tom
  • 42,844
  • 35
  • 95
  • 101
108
votes
13 answers

Preventing iframe caching in browser

How do you prevent Firefox and Safari from caching iframe content? I have a simple webpage with an iframe to a page on a different site. Both the outer page and the inner page have HTTP response headers to prevent caching. When I click the "back"…
JR.
  • 5,840
  • 9
  • 31
  • 34
104
votes
7 answers

Prevent user from seeing previously visited secured page after logout

I have the requirement that the end user should not be able to go back to the restricted page after logout/sign out. But currently the end user is able to do that by the browser back button, visiting browser history or even by re-entering the URL in…
raaz
  • 12,410
  • 22
  • 64
  • 81
99
votes
9 answers

How does the Back button in a web browser work?

I searched the Web about this question but I found nothing: What is the logic of the back button? What is happening when we hit the back button on a Web browser? I really would like to understand more about that.
Pierre Thibault
  • 1,895
  • 2
  • 19
  • 22
97
votes
8 answers

Prevent safari loading from cache when back button is clicked

Got an issue with safari loading old youtube videos when back button is clicked. I have tried adding onunload="" (mentioned here Preventing cache on back-button in Safari 5) to the body tag but it doesn't work in this case. Is there any way to…
Mark Steggles
  • 5,369
  • 8
  • 40
  • 50
72
votes
14 answers

React Native - Device back button handling

I want to check if there are more than one screens are on stack when device back button is hit. If yes, I want to show previous screen and if no, I want to exit app. I have checked number of examples but those use BackAndroid and Navigator. But both…
Virat18
  • 3,427
  • 2
  • 23
  • 29
63
votes
13 answers

Android - Switch ActionBar Back Button to Navigation Button

I am having the following problem: I know how to set up a toolbar to show a back button icon instead of a burger button icon. From this: to this: using: getSupportActionBar().setDisplayHomeAsUpEnabled(true); Now, I want to do the reverse action,…
62
votes
10 answers

Flutter Back button with return data

I have an interface with two buttons that pop and return true or false, like so: onPressed: () => Navigator.pop(context, false) I need to adapt the back button in the appbar, so it pops and also returns false. Is there a way to accomplish this?
aksn
  • 2,341
  • 4
  • 17
  • 21
55
votes
5 answers

Preventing the back button from cancelling a DialogFragment

I have a Fragment that can create and pop up a DialogFragment, but when I hit the back button, it dismisses the dialog even though I explicitly call setCancelable(false); Is there any way for my DialogFragment to be insensative to the back…
MattF
  • 1,475
  • 3
  • 16
  • 18
54
votes
9 answers

Chrome displays ajax response when pressing back button

I've come across a problem that if I use jQuery's Get method to get some content, if I click back, instead of it actually going back one page in the history, it instead shows the content returned by the Ajax query. Any…
Gavin
  • 6,284
  • 5
  • 30
  • 38
53
votes
2 answers

Alert, confirm, and prompt not working after using History API on Safari, iOS

After calling history.pushState in Safari on iOS, it's no longer possible to use alert(), confirm() or prompt(), when using the browser back button to change back. Is this an iOS bug? Are there any known workarounds? Simple example to reproduce this…
dan
  • 5,377
  • 13
  • 39
  • 44
1
2 3
99 100