Skip to main content

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.

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.

How It Works

When SplashScreen 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.
1

Initialize the Layout

onCreate() inflates activity_splash_screen and locks the activity into landscape orientation.
2

Play Background Music

A MediaPlayer instance is created with R.raw.background_music and begins playing immediately, looping throughout the splash experience.
3

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.
4

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.
5

Advance to Mode Selection

Tapping the on-screen button calls showmain(View), which starts Select_act and finishes the splash activity so it is removed from the back stack.

Lifecycle Behavior

The MediaPlayer is carefully managed across the activity lifecycle to avoid resource leaks and ensure music resumes correctly when the app returns to the foreground.
Lifecycle EventAction
onCreateCreate MediaPlayer, load R.raw.background_music, start playback; run all six zoom animations
onResumeRestart the MediaPlayer so music resumes after the app returns from background
onStopRelease the MediaPlayer to free audio resources when the activity is no longer visible
onRestartRecreate 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.
The showmain 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.
public void showmain(View view) {
    startActivity(new Intent(SplashScreen.this, Select_act.class));
    finish();
}
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.
If you need to extend the splash duration (for example, to await a network check), add your async logic before calling showmain rather than using a fixed Handler delay, so the transition happens as soon as the app is ready rather than after an arbitrary wait.

Build docs developers (and LLMs) love