Nested classes |
interface |
SplashScreen.OnExitAnimationListener
Listens for the splash screen exit event.
|
Constants
SPLASH_SCREEN_STYLE_ICON
public static final int SPLASH_SCREEN_STYLE_ICON
Flag to be used with ActivityOptions.setSplashScreenStyle
, to show the splash screen
icon of the launched activity.
Constant Value:
1
(0x00000001)
SPLASH_SCREEN_STYLE_SOLID_COLOR
public static final int SPLASH_SCREEN_STYLE_SOLID_COLOR
Flag to be used with ActivityOptions.setSplashScreenStyle
, to avoid showing the
splash screen icon of the launched activity
Constant Value:
0
(0x00000000)
Public methods
clearOnExitAnimationListener
public abstract void clearOnExitAnimationListener ()
Clear exist listener
setOnExitAnimationListener
public abstract void setOnExitAnimationListener (SplashScreen.OnExitAnimationListener listener)
Specifies whether an Activity
wants to handle the splash screen animation on its
own. Normally the splash screen will show on screen before the content of the activity has
been drawn, and disappear when the activity is showing on the screen. With this listener set,
the activity will receive OnExitAnimationListener.onSplashScreenExit
callback if
splash screen is showed, then the activity can create its own exit animation based on the
SplashScreenView.
Note that this method must be called before splash screen leave, so it only takes effect
during or before Activity.onResume
.
Parameters |
listener |
SplashScreen.OnExitAnimationListener : the listener for receive the splash screen with
This value cannot be null . |
setSplashScreenTheme
public abstract void setSplashScreenTheme (int themeId)
Overrides the theme used for the SplashScreen
s of this application.
By default, the SplashScreen
uses the theme set in the manifest. This method
overrides and persists the theme used for the SplashScreen
of this application.
To reset to the default theme, set this the themeId to Resources.ID_NULL
.
Note: Internally, the theme name is resolved and persisted. This means that the theme
name must be stable across versions, otherwise it won't be found after your application is
updated.
Parameters |
themeId |
int : The ID of the splashscreen theme to be used in place of the one defined in
the manifest. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# SplashScreen\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nSplashScreen\n============\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/window/SplashScreen \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nSplashScreen\n`\n\n\n`\n\n\n`\n\n|-----------------------------|\n| android.window.SplashScreen |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe interface that apps use to talk to the splash screen.\n\n\nEach splash screen instance is bound to a particular [Activity](/reference/android/app/Activity).\nTo obtain a [SplashScreen](/reference/android/window/SplashScreen) for an Activity, use\n`Activity.getSplashScreen()` to get the SplashScreen.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Nested classes ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` interface` | [SplashScreen.OnExitAnimationListener](/reference/android/window/SplashScreen.OnExitAnimationListener) Listens for the splash screen exit event. |\n\n| ### Constants ||\n|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | [SPLASH_SCREEN_STYLE_ICON](/reference/android/window/SplashScreen#SPLASH_SCREEN_STYLE_ICON) Flag to be used with [ActivityOptions.setSplashScreenStyle](/reference/android/app/ActivityOptions#setSplashScreenStyle(int)), to show the splash screen icon of the launched activity. |\n| `int` | [SPLASH_SCREEN_STYLE_SOLID_COLOR](/reference/android/window/SplashScreen#SPLASH_SCREEN_STYLE_SOLID_COLOR) Flag to be used with [ActivityOptions.setSplashScreenStyle](/reference/android/app/ActivityOptions#setSplashScreenStyle(int)), to avoid showing the splash screen icon of the launched activity |\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[clearOnExitAnimationListener](/reference/android/window/SplashScreen#clearOnExitAnimationListener())`() ` Clear exist listener |\n| ` abstract void` | ` `[setOnExitAnimationListener](/reference/android/window/SplashScreen#setOnExitAnimationListener(android.window.SplashScreen.OnExitAnimationListener))`(`[SplashScreen.OnExitAnimationListener](/reference/android/window/SplashScreen.OnExitAnimationListener)` listener) ` \u003cbr /\u003e Specifies whether an [Activity](/reference/android/app/Activity) wants to handle the splash screen animation on its own. |\n| ` abstract void` | ` `[setSplashScreenTheme](/reference/android/window/SplashScreen#setSplashScreenTheme(int))`(int themeId) ` Overrides the theme used for the [SplashScreen](/reference/android/window/SplashScreen)s of this application. |\n\nConstants\n---------\n\n### SPLASH_SCREEN_STYLE_ICON\n\nAdded in [API level 33](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int SPLASH_SCREEN_STYLE_ICON\n```\n\nFlag to be used with [ActivityOptions.setSplashScreenStyle](/reference/android/app/ActivityOptions#setSplashScreenStyle(int)), to show the splash screen\nicon of the launched activity.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\n### SPLASH_SCREEN_STYLE_SOLID_COLOR\n\nAdded in [API level 33](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int SPLASH_SCREEN_STYLE_SOLID_COLOR\n```\n\nFlag to be used with [ActivityOptions.setSplashScreenStyle](/reference/android/app/ActivityOptions#setSplashScreenStyle(int)), to avoid showing the\nsplash screen icon of the launched activity\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\nPublic methods\n--------------\n\n### clearOnExitAnimationListener\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void clearOnExitAnimationListener ()\n```\n\nClear exist listener\n\n\u003cbr /\u003e\n\n**See also:**\n\n- [setOnExitAnimationListener(OnExitAnimationListener)](/reference/android/window/SplashScreen#setOnExitAnimationListener(android.window.SplashScreen.OnExitAnimationListener)) \n\n### setOnExitAnimationListener\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void setOnExitAnimationListener (SplashScreen.OnExitAnimationListener listener)\n```\n\n\u003cbr /\u003e\n\nSpecifies whether an [Activity](/reference/android/app/Activity) wants to handle the splash screen animation on its\nown. Normally the splash screen will show on screen before the content of the activity has\nbeen drawn, and disappear when the activity is showing on the screen. With this listener set,\nthe activity will receive [OnExitAnimationListener.onSplashScreenExit](/reference/android/window/SplashScreen.OnExitAnimationListener#onSplashScreenExit(android.window.SplashScreenView)) callback if\nsplash screen is showed, then the activity can create its own exit animation based on the\nSplashScreenView.\n\nNote that this method must be called before splash screen leave, so it only takes effect\nduring or before [Activity.onResume](/reference/android/app/Activity#onResume()).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|-----------------------------------------------------------------------------------------------------------------------------|\n| `listener` | `SplashScreen.OnExitAnimationListener`: the listener for receive the splash screen with This value cannot be `null`. \u003cbr /\u003e |\n\n**See also:**\n\n- [SplashScreen.OnExitAnimationListener.onSplashScreenExit(SplashScreenView)](/reference/android/window/SplashScreen.OnExitAnimationListener#onSplashScreenExit(android.window.SplashScreenView)) \n\n### setSplashScreenTheme\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void setSplashScreenTheme (int themeId)\n```\n\nOverrides the theme used for the [SplashScreen](/reference/android/window/SplashScreen)s of this application.\n\n\nBy default, the [SplashScreen](/reference/android/window/SplashScreen) uses the theme set in the manifest. This method\noverrides and persists the theme used for the [SplashScreen](/reference/android/window/SplashScreen) of this application.\n\n\nTo reset to the default theme, set this the themeId to [Resources.ID_NULL](/reference/android/content/res/Resources#ID_NULL).\n\n\n**Note:** Internally, the theme name is resolved and persisted. This means that the theme\nname must be stable across versions, otherwise it won't be found after your application is\nupdated.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|--------------------------------------------------------------------------------------------------------|\n| `themeId` | `int`: The ID of the splashscreen theme to be used in place of the one defined in the manifest. \u003cbr /\u003e |"]]