If I press back button on main screen, application should exit to android home screen, but does not exit.
Do I need to do something to enable _drupalgap_back_exit(button) function?

I'm using
drupalgap module 7.x-1.10
SDK 7.x-1.0-rc5 and development snapshot
Android 4.4

Comments

tyler.frankenstein’s picture

Title: Back button » On screen back button not exiting app
Status: Active » Needs work

Please look at the drupalgap_back(), _drupalgap_back() and _drupalgap_back_exit() to see how it handles the "onscreen" back button, vs. the Android hardware button. If you're clicking the onscreen back button, then I'm fairly certain it will not exist the app. If you click the hardware back button it should. However, it's up to you to decide when the onscreen back button is visible. Either way, check out those functions, add some debug statements to them and see if you can figure out what is going on please. Make a fork of the SDK on GitHub to get started.

coolman7’s picture

If I press hardware back button on some different pages of application, application navigates to previous pages as expected.

But If I press hardware back button on home screen of application, it does not exit and stays at home screen of application.

tyler.frankenstein’s picture

Title: On screen back button not exiting app » App does not exit when Android hardware back button is pressed on home screen
Issue tags: -exit
mfrosch’s picture

Hey together,

at the beginning I also thought this is not working. But actually you only have to add the dialog Plugin.

If you are using phoneGap Build you can use following line in your config.xml:
<gap:plugin name="org.apache.cordova.dialogs" />

Hope it helps.

Cheers,
Matthias

tyler.frankenstein’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.