FAQ Database Discussion Community

Dynamically change NavigationBar Back Button Text from presented ViewController

I'm trying to change the back button text on a UINavigationBar upon receiving something from the network - basically replicating iMessage/FB Messenger by adding a new message count to the back button text ie. < Back (1) or < Messages (2) I can change the back button text from the...

How to add sound when back button is pressed in complete application

My application is very big and has many activities and fragments, is there any easy option to add sound when back button is pressed anytime anywhere in app?

Cordova Angular Android back button does not trigger ng-if

In Cordova Angular, back button does not seem to trigger ng-if. I have my code like this: html <div class="buttons" ng-if="!isNavButtonActive()"> <a class="button icon-left ion-chevron-left button-clear"> {{ isExitBackActive() ? "Exit" : "Back" }} </a> </div> controller $scope.isNavButtonActive = function(){ return $location.path() === '/app/menu'; } $scope.isExitBackActive = function(){ if($rootScope.previousState === '/app/menu')...

Android - Back button doesn't call onResume()

I'm a beginner at this, so bear with me. In my app, I want the theme of the app to update based upon user preference. I have a preferences page with a theme section, and here is the code for my MainActivity: @Override protected void onCreate(Bundle savedInstanceState) { SharedPreferences preferences...

android go back to previous view

I am working on a android application and i want to exit the application on back press when it comes to state where no view is available to go back. Until then it should go to the previous view on back press. How can i do this. What i need...

code in willTransition callback executed after model callback after a window.alert

I recently encountered a bug with Ember.js. Basically when I click the browser back button in Firefox, Ember.js executes the code in wrong order. The code in willTransition callback right after the line alert("..."); is executed after model callback, which should normally be executed right after alert("..."); is returned. The...

Hide and show back button in navigationBar

I have these two methods: func showSpinner() { let spinner = UIActivityIndicatorView(activityIndicatorStyle: .White) spinner.startAnimating() self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: spinner) self.navigationItem.hidesBackButton = true } func hideSpinner() { self.navigationItem.leftBarButtonItem = nil self.navigationItem.hidesBackButton = false } In viewDidLoad I call showSpinner and then after data loaded I call hideSpinner. But backButton often jumping on...

Toast “Press back again to close” gives error when pressing back too often

My goal: When a visitor goes back to the first page of my app, a toast appears to let the visitor know that he can press the back button again within 3 seconds to close the Android app. Specific problem: When you went back to the first page and the...

how to change behaviour back button in android

My app includes tts and stt. My app works by voice command. So, I want to use the back button. When the user click back button, the app should go to the first step, but it didn't. My code; public class SpeechActivity extends FragmentActivity implements Const { protected PowerManager.WakeLock mWakeLock;...

Go back after open google map by href in Android App

In my Android App, I have a link that opens a Google Maps URL to show the user how to go to from its location to a certain place. The problem, is that the link opens over my App and I can't go back to it pressing the phone's back...

onPause(), different results from home and back button

I'm creating an application which uses locationManager() to handle updates from the GPS. When the app is closed, I want the updates from the locationManager to stop and has this piece of code at the moment. @Override protected void onPause() { super.onPause(); if(locationManager != null){ locationManager.removeUpdates(locationListener); } When I exit...

Cordova 3.5 - Back button event firing in Android emulator but not firing in real android device

I'm using cordova 3.5 to develop an android application, I want to close the application when back button is pressed. I'm using the following code - document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { document.addEventListener("backbutton", backKeyDown, true); }; function backKeyDown(){ if(confirm("Exit Application?")) { navigator.app.exitApp(); } }; This code seems to work fine...

exit app on double tap (andriod app)

Please help me this code. Am totally stuck here with the following code. Mainly am not a programmer so please help with this... where do i need to paste this code exactly in c# script in unity... Because am confused that we have to write using unityengine; using system.collections, bla...

UIButton – what is the default image highlight color

Is there any approach how to create from some color (let's say it's [UIColor redColor]) the default highlighted shade of this color (some kind of dark red color in this case). In my case, I have a UIButton (inside of UIBarButton) and I would like to setup the titleColor for...

pushState Executing When Not Supposed To

I am using the HTML history API to manipulate the browser history stack to control navigation using JavaScript on my site. The function I have set up to change pages is working fine, but weirdly, when I added pushState to each individual page change, the pushState fires automatically, so that...

AirPrint shows two back (< <) icons

i am willing to export some pdf files from my application using AirPrint in iOS. however when i present the UIPrintInteractionController it shows two back icons as < <. I have attached the images and code to get what i am doing. I think the icons are one for my...

Back-Button in ActionBar NullPointerException

I got an NullPointerException when i click at the back-button in the Actionbar at these lines: public class CustomAdapterTasks extends BaseAdapter { Base64EncodeDecode base64EncodeDecode = new Base64EncodeDecode(); private ArrayList<HashMap<String, String>> taskItems; private static LayoutInflater inflater = null; private Bitmap bm; public CustomAdapterTasks(Context context, ArrayList<HashMap<String, String>> items) { super(); Context contex1t...

How to use Web Browser's BACK-BUTTON ? in java web applications

in javascript we can call history.back( ); method to go back to previous page. is there any way to implement same functionality in java web applications / servlets?