The splash screen is the launcher activity for the Kids Learning App, serving as the very first thing a child sees when the app opens. Running in landscape orientation with a fully immersive fullscreen layout, it combines animated visuals and background music to create an engaging entry experience before handing off control to the mode selection screen.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/SaadAhmed1122/Kids_learnig_App/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
WhenSplashScreen starts, it orchestrates three things simultaneously: it fires up a MediaPlayer with the app’s background music track, triggers a sequence of six zoom animations across the screen’s image views and text elements, and hides all system UI chrome to fill the display edge-to-edge. Once the animations settle, the user taps a button to proceed.
Initialize the Layout
onCreate() inflates activity_splash_screen and locks the activity into landscape orientation.Play Background Music
A
MediaPlayer instance is created with R.raw.background_music and begins playing immediately, looping throughout the splash experience.Run Zoom Animations
Six animations —
zoom_in, zoom1, zoom2, zoom3, zoom4, and zoom5 — are loaded and applied to the screen’s image views and text elements in sequence, bringing the splash artwork to life.Enable Immersive Fullscreen
hideSystemUI() applies SYSTEM_UI_FLAG_IMMERSIVE along with the standard fullscreen and hide-navigation flags, removing the status bar and navigation bar for a distraction-free presentation.Lifecycle Behavior
TheMediaPlayer is carefully managed across the activity lifecycle to avoid resource leaks and ensure music resumes correctly when the app returns to the foreground.
| Lifecycle Event | Action |
|---|---|
onCreate | Create MediaPlayer, load R.raw.background_music, start playback; run all six zoom animations |
onResume | Restart the MediaPlayer so music resumes after the app returns from background |
onStop | Release the MediaPlayer to free audio resources when the activity is no longer visible |
onRestart | Recreate the MediaPlayer instance so it is ready for the next onResume call |
Because
onStop fully releases the MediaPlayer (rather than just pausing it), onRestart must recreate the instance from scratch before onResume attempts to restart playback. Skipping the recreate step in onRestart would cause a null-reference error when onResume fires.Navigating to Mode Selection
Theshowmain method is the sole exit point from the splash screen. It starts the Select_act activity and immediately calls finish() so the splash screen is not retained in the back stack — pressing Back from the mode selection screen exits the app rather than returning to the splash.
SplashScreen is declared as the launcher activity in the Android manifest and is locked to landscape orientation. The app will not rotate to portrait at any point during the splash sequence.