back-button
Disabling Back button on the browser [closed]
It’s not possible, sadly. However, consider your applications navigation model. Are you using Post/Redirect/Get PRG Model? http://en.wikipedia.org/wiki/Post/Redirect/Get? This model is more back button friendly than the Postback model.
Can I update window.location.hash without having the web page scroll?
To change the hash without having the page reload/scroll, you can now simply use html5 history.pushState. history.pushState(null,null,’#hashexample’); It’s supported by all the major browsers: http://caniuse.com/history MDN: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history#The_pushState().C2.A0method Also note that the last url parameter we’re using here can be any url, so it’s not limited to hashes.
How to disable Browser back button in Angular 2
Not sure if this is already sorted, but posting the answer nonetheless, for future references. To tackle this, you basically need to add a listener in your app-component and setup a canDeactivate guard on your angular-router. // in app.component.ts import { LocationStrategy } from ‘@angular/common’; @Component({ selector: ‘app-root’ }) export class AppComponent { constructor( private … Read more
Android: Quit application when press back button
When you press back and then you finish your current activity(say A), you see a blank activity with your app logo(say B), this simply means that activity B which is shown after finishing A is still in backstack, and also activity A was started from activity B, so in activity, You should start activity A … Read more
browser back acts on nested iframe before the page itself – is there a way to avoid it?
I’ve found the answer to my problem guess it could be useful for others out there. The problem was with the way i assigned new URLs to my Iframe, i used Jquery so it looked something like that: $(‘#myIFrame’).attr(‘src’,newUrl); When assigning the URL in that manner it adds a new entry to the browser’s list … Read more
PhoneGap – android exit on backbutton
You need to wait for the device to be ready to add the event listener: document.addEventListener(“deviceready”, onDeviceReady, false); function onDeviceReady(){ document.addEventListener(“backbutton”, function(e){ if($.mobile.activePage.is(‘#homepage’)){ e.preventDefault(); navigator.app.exitApp(); } else { navigator.app.backHistory(); } }, false); }
How to change color of back button on NavigationView
You can use the accentColor property on the NavigationView to set the back button color, like in this example: var body: some View { NavigationView { List(1..<13) { item in NavigationLink(destination: Text(“\(item) x 8 = \(item*8)”)) { Text(String(item)) } }.navigationBarTitle(“Table of 8”) }.accentColor(.black) // <- note that it’s added here and not on the List … Read more
Change UINavigationBar back button title
Do this in the parent view controller not in the child Swift navigationItem.backBarButtonItem = UIBarButtonItem(title: “Back”, style: .plain, target: nil, action: nil) Objetive-C self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@”Back” style:UIBarButtonItemStylePlain target:nil action:nil];
How to exit when back button is pressed?
In my Home Activity I override the “onBackPressed” to: @Override public void onBackPressed() { Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } so if the user is in the home activity and press back, he goes to the home screen. I took the code from Going to home screen Programmatically