FlixelAndroidHostIntegration
View sourceclass
org.flixelgdx.backend.android.FlixelAndroidHostIntegration
Android FlixelHostIntegration: system notifications via NotificationManager, screen wake lock via FLAG_KEEP_SCREEN_ON, back-button exit confirmation via an InputMultiplexer, and text clipboard access via ClipboardManager.
Installed automatically by FlixelAndroidLauncher; game code should not need to instantiate this directly.
Notification permission
Android 13 (API 33) and above require the POST_NOTIFICATIONS runtime permission before notifications are displayed. Call FlixelAndroidHostIntegration.requestNotificationPermission() early in your game, ideally during a loading screen or in response to a user gesture, and confirm FlixelAndroidHostIntegration.supportsNotifications() returns true before calling FlixelAndroidHostIntegration.sendNotification(String, String).
You must also declare the permission in your AndroidManifest.xml:
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
Exit confirmation
When a message is set via FlixelAndroidHostIntegration.setExitConfirmation(String), the hardware or gesture back action is caught by an InputMultiplexer inserted in front of any existing InputProcessor. Pressing back shows an AlertDialog with the message and an "Exit" button that calls Gdx.app.exit(). Passing null removes the guard and restores the previous processor.