Phonegap - button for the main phone home screen

I am currently using PhoneGap build 2.9.0 to create a simple application, and I was wondering if it is possible to create a button that will take the user outside of your application and the default home screen of the phones.

I'm trying to imitate the close button, I understand that you cannot close applications with iOS, but you can use Android and BlackBerry. Therefore, my solution is to try to redirect the default user home screen to your phone (instead of forcibly closing the application).

Any ideas?

+4
source share
2 answers

You really should not have a close (stop) button in Android - the OS was designed to close applications on your own. For Android you can use:

navigator.device.exitApp(); 

More on this: http://community.phonegap.com/nitobi/topics/how_to_exit_from_the_phonegap_app_on_android_and_ios

+1
source

In iOS, Apple does not allow software programs to exit the program.

Hope this helps.

+1
source

Source: https://habr.com/ru/post/1492297/


All Articles