开发者

Android: Splash screen issues

On my Android App, I have set up a splash screen. The splash screen opens when 开发者_C百科the app is opened and lasts for two seconds before it redirects to a login screen.

The issue I am having is that the splash screen displays once, and then re-directs to the login screen. BUT when I click on the app again it goes straight to the login screen ignoring the splash screen. Is there a reason for this? Does it automatically open on your last screen? Because then if I hit the back button when it opens on the login screen it DOES go back to the splash screen but then doesn't redirect to the login screen after 2 seconds.


Yes this is normal behavior. When you hit the back button after the second launch you are ending the app, thus your splash screen shows on the next launch. You will need to add an intent to your login activity's on resume method to launch your splash screen. Here is a on resume example. Android example which uses onResume, onStart and onRestart


Set clearTaskOnLaunch via the Android Manifest of your project to true. This will clear the task/stack history whenever the activity is launched.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜