How to quit app using back button.

Hi.
Now I am developing a simple app, but I am having trouble in making my app terminate.
On my android phone Galaxy A5, when pushing back button, my app doesn’t quit. It stays as it is.
In order to quit the app, I have to open my background app lists and push X button there.
I want to know how I can make my app turn off upon pushing back button.
I found the keyword , but I don’t know how i can make it from here.
Thanks!

1 Like

Hi!

We don’t currently have any API for doing this out of the box, but it could probably be achieved using foreign code.
Then you’d unfortunately have to dig into Uno and some Java to make that happen.

Here is an article covering foreign code:
https://www.fusetools.com/docs/native-interop/foreign-code

And here is how you can expose uno functionality as a JavaScript API:
https://www.fusetools.com/docs/native-interop/native-js-modules

If you want to give it a try, i’m sure you can get a lot of assistance from the community on slack:
sign up here if you haven’t already :slight_smile:
https://slackcommunity.fusetools.com/

I’ve made a an internal issue for this, but can’t guarantee when it will get fixed yet.