app/src/main/cpp/main.cpp
static void app_handle_cmd(struct android_app *app, int32_t cmd) {
    AndroidAppState *appState = (AndroidAppState *) app->userData;

    switch (cmd) {
        // There is no APP_CMD_CREATE. The ANativeActivity creates the
        // application thread from onCreate(). The application thread
        // then calls android_main().
        case APP_CMD_START: {
            Log::Write(Log::Level::Info, "    APP_CMD_START");
            Log::Write(Log::Level::Info, "onStart()");
            break;
        }
        case APP_CMD_RESUME: {
            Log::Write(Log::Level::Info, "onResume()");
            Log::Write(Log::Level::Info, "    APP_CMD_RESUME");
            appState->Resumed = true;
            break;
        }
        case APP_CMD_PAUSE: {
            Log::Write(Log::Level::Info, "onPause()");
            Log::Write(Log::Level::Info, "    APP_CMD_PAUSE");
            appState->Resumed = false;
            break;
        }
        case APP_CMD_STOP: {
            Log::Write(Log::Level::Info, "onStop()");
            Log::Write(Log::Level::Info, "    APP_CMD_STOP");
            break;
        }
        case APP_CMD_DESTROY: {
            Log::Write(Log::Level::Info, "onDestroy()");
            Log::Write(Log::Level::Info, "    APP_CMD_DESTROY");
            appState->NativeWindow = NULL;
            break;
        }
        case APP_CMD_INIT_WINDOW: {
            Log::Write(Log::Level::Info, "surfaceCreated()");
            Log::Write(Log::Level::Info, "    APP_CMD_INIT_WINDOW");
            appState->NativeWindow = app->window;
            break;
        }
        case APP_CMD_TERM_WINDOW: {
            Log::Write(Log::Level::Info, "surfaceDestroyed()");
            Log::Write(Log::Level::Info, "    APP_CMD_TERM_WINDOW");
            appState->NativeWindow = NULL;
            break;
        }
    }
}
/**
 * Process the next main command.
 */
Process the next main command.
Process the next main command .
static void app_handle_cmd(struct android_app *app, int32_t cmd) {
    AndroidAppState *appState = (AndroidAppState *) app->userData;
    switch (cmd) {
        case APP_CMD_START: {
            Log::Write(Log::Level::Info, "    APP_CMD_START");
            Log::Write(Log::Level::Info, "onStart()");
            break;
        }
        case APP_CMD_RESUME: {
            Log::Write(Log::Level::Info, "onResume()");
            Log::Write(Log::Level::Info, "    APP_CMD_RESUME");
            appState->Resumed = true;
            break;
        }
        case APP_CMD_PAUSE: {
            Log::Write(Log::Level::Info, "onPause()");
            Log::Write(Log::Level::Info, "    APP_CMD_PAUSE");
            appState->Resumed = false;
            break;
        }
        case APP_CMD_STOP: {
            Log::Write(Log::Level::Info, "onStop()");
            Log::Write(Log::Level::Info, "    APP_CMD_STOP");
            break;
        }
        case APP_CMD_DESTROY: {
            Log::Write(Log::Level::Info, "onDestroy()");
            Log::Write(Log::Level::Info, "    APP_CMD_DESTROY");
            appState->NativeWindow = NULL;
            break;
        }
        case APP_CMD_INIT_WINDOW: {
            Log::Write(Log::Level::Info, "surfaceCreated()");
            Log::Write(Log::Level::Info, "    APP_CMD_INIT_WINDOW");
            appState->NativeWindow = app->window;
            break;
        }
        case APP_CMD_TERM_WINDOW: {
            Log::Write(Log::Level::Info, "surfaceDestroyed()");
            Log::Write(Log::Level::Info, "    APP_CMD_TERM_WINDOW");
            appState->NativeWindow = NULL;
            break;
        }
    }
}
static void app_handle_cmd ( struct android_app * app , int32_t cmd ) { AndroidAppState * appState = ( AndroidAppState * ) app -> userData ; switch ( cmd ) { case APP_CMD_START : { Log :: Write ( Log :: Level :: Info , " " ) ; Log :: Write ( Log :: Level :: Info , " " ) ; break ; } case APP_CMD_RESUME : { Log :: Write ( Log :: Level :: Info , " " ) ; Log :: Write ( Log :: Level :: Info , " " ) ; appState -> Resumed = true ; break ; } case APP_CMD_PAUSE : { Log :: Write ( Log :: Level :: Info , " " ) ; Log :: Write ( Log :: Level :: Info , " " ) ; appState -> Resumed = false ; break ; } case APP_CMD_STOP : { Log :: Write ( Log :: Level :: Info , " " ) ; Log :: Write ( Log :: Level :: Info , " " ) ; break ; } case APP_CMD_DESTROY : { Log :: Write ( Log :: Level :: Info , " " ) ; Log :: Write ( Log :: Level :: Info , " " ) ; appState -> NativeWindow = NULL ; break ; } case APP_CMD_INIT_WINDOW : { Log :: Write ( Log :: Level :: Info , " " ) ; Log :: Write ( Log :: Level :: Info , " " ) ; appState -> NativeWindow = app -> window ; break ; } case APP_CMD_TERM_WINDOW : { Log :: Write ( Log :: Level :: Info , " " ) ; Log :: Write ( Log :: Level :: Info , " " ) ; appState -> NativeWindow = NULL ; break ; } } }
Process the next main command.
Process the next main command .
// There is no APP_CMD_CREATE. The ANativeActivity creates the // application thread from onCreate(). The application thread // then calls android_main().