how to close android app completely

To Quit Application on Button click use this code : Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); startActivity(intent); Try it.. To kill the complete app and remove it from Runningapp list kill the app through its pid(its nasty)… use this lines before above code. int pid = android.os.Process.myPid(); android.os.Process.killProcess(pid);

Phonegap – navigator.app.backHistory() not working on HTML back button

I have tried 3 separate things when I faced the same situation: window.history.back() navigator.app.backHistory(); History.go(-1); Individually, none of these solve the problem. I put all 3 things together and much to my surprise it worked. I really don’t know what is behind it. Then I decreased to two functions and removed: window.history.back() Now I am … Read more

How to handle back button on Ionic 2

Here’s how I did it: In every Page component, I created a function called backButtonAction(), which will execute custom code for every page. Code: import { Component } from ‘@angular/core’; import { Platform, NavController, ModalController } from ‘ionic-angular’; import { DetailsModal } from ‘./details’; @Component({ selector: ‘page-appointments’, templateUrl: ‘appointments.html’ }) export class AppointmentsPage { modal: … Read more