How can I do a proper exit from an OF Android app, such that whe I exit manually, the app is also removed from recent screen?
Currently, I use:
ofExit(); // doesn't exit fully on android? std::exit(0); // does exit fully on android!
… and as it says,
ofExit() doesn’t exit fully (it apparently just calls
ofApp::exit() which could also be empty?), while
std::exit(0) does - however, even in this case, the application will remain in Recent screens, and will start up anew if called from there.
std::exit(0), sometimes (but not always), I will get the message “Unfortunately, YOUR_APP has stopped.” issued by Android, which is the message Android shows when an application crashes, so users don’t like it.
Also, I am aware I could use
… but I’m not exactly sure what I should include here - except, I know I shouldn’t use
ofExit() here, as it causes recursion (since it apparently calls
So, what would be the right way to close an Android app - including removal from Recent apps screen - upon a handler (say, from a click on a button)?