应用启动画面仅显示在 Android Studio 的 install/run 上
App splash screen is only shown over an install/run of Android Studio
我用本教程实现了启动画面:https://www.bignerdranch.com/blog/splash-screens-the-right-way/
如果我 install/run 通过 Android Studio 应用程序,我可以在应用程序启动时看到启动画面。现在我通过 Android Studio 或 "close all Apps" 从我的 phone 关闭应用程序,我想直接通过我的 phone 中的图标启动应用程序。但是我看不到启动画面。只有在我实现启动画面之前出现的白色屏幕。如果我在 MainActivity 中进行更改 - 这些更改位于 phone.
有人知道哪里出了问题吗?
确保这个带有 Launcher 的 intent 过滤器仅在清单中的 SplashActivity 中。
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
否则请提供您的清单和 SplashActivity 代码。
这是因为您正在 运行调试构建。尝试 运行 在您的设备中实现构建。
在发布版本中启用压缩资源、缩小并应用混淆器
示例如下
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-rules.txt'
zipAlignEnabled true
我用本教程实现了启动画面:https://www.bignerdranch.com/blog/splash-screens-the-right-way/
如果我 install/run 通过 Android Studio 应用程序,我可以在应用程序启动时看到启动画面。现在我通过 Android Studio 或 "close all Apps" 从我的 phone 关闭应用程序,我想直接通过我的 phone 中的图标启动应用程序。但是我看不到启动画面。只有在我实现启动画面之前出现的白色屏幕。如果我在 MainActivity 中进行更改 - 这些更改位于 phone.
有人知道哪里出了问题吗?
确保这个带有 Launcher 的 intent 过滤器仅在清单中的 SplashActivity 中。
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
否则请提供您的清单和 SplashActivity 代码。
这是因为您正在 运行调试构建。尝试 运行 在您的设备中实现构建。 在发布版本中启用压缩资源、缩小并应用混淆器
示例如下
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-rules.txt'
zipAlignEnabled true