Otherwise the OS may try to start the activity again in the same process,
which doesn't work because of Application::run semantics.
#include <cstring>
+#include <cstdlib>
#include <msp/fs/dir.h>
#include <msp/fs/path.h>
#include <msp/fs/utils.h>
Msp::Application::run(1, argv, this, &app_created);
free(appname);
if(activity)
+ {
+ activity->callbacks->onDestroy = &end_process;
ANativeActivity_finish(activity);
+ }
+ else
+ end_process(0);
}
void MainThread::app_created(void *data)
reinterpret_cast<MainThread *>(activity->instance)->signal_input_queue_destroyed.emit(queue);
}
+void MainThread::end_process(ANativeActivity *)
+{
+ exit(0);
+}
+
} // namespace Android
} // namespace Msp
static void native_window_destroyed(ANativeActivity *, ANativeWindow *);
static void input_queue_created(ANativeActivity *, AInputQueue *);
static void input_queue_destroyed(ANativeActivity *, AInputQueue *);
+ static void end_process(ANativeActivity *);
};
} // namespace Android