admin管理员组文章数量:1401639
I'm experiencing problems with the Android Splash API. The scenario is as follows: When I first launch my application, the Splash screen displays correctly (everything works fine). The issue occurs when I close the app - for example, when I'm on the Login screen or any other screen - using System.exit(1) or finishAffinity(). When I try to reopen the app from the recent apps screen, the application freezes for several seconds and becomes unresponsive. After this delay, the LoginActivity finally appears. I investigated with logs and discovered that SplashActivity is executing in the background, but the Splash UI isn't visible during this freeze period. When I removed the Splash API completely, the app works smoothly without freezing, but now I'm showing two splash screens (which Google warns against in their guidelines). Here's my implementation:
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
super.onCreate(savedInstanceState);
splashScreen.setKeepOnScreenCondition(() -> true);
// Service call
// Gets the service data and navigates to Login (SplashActivity -> LoginActivity)
}
I expected the app to show the splash screen smoothly when reopening, the same way it does on the initial launch. I'm looking for a solution that allows me to use the Splash API correctly while avoiding the freezing issue when reopening the app after it's been force-closed.
本文标签: Issues with Android Splash APIStack Overflow
版权声明:本文标题:Issues with Android Splash API - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744273642a2598305.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论