开发者

Android splash Activity only shows up once

I have created a slash screen for my Android app following this tutorial. Basically it's just start a Thread in the onCreate() of the splash Activity, and wait for a short period of time before switch to the main activity.

This works fine ... only on the first time running. T开发者_运维问答he splash screen only shows up once after installation or rebooting my phone. On the second time, the app just skips the splash Activity like it doesn't exists.

I suspect it has something to do with Android Activity life cycle, maybe the app doesn't really exist and stays in memory. I tried killing it by: 1) Using the "Advanced Task Manager" app, and 2) Programmatically killing it in onDestory(), but none of those worked. The splash screen still won't show up after the first time.

Can anyone help me with this? Thanks a lot,


Instead of putting it in your onCreate() you could try to put it in the onStart() method. That way it'll show for each launch not just each creation which might get around your lifecycle issue.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜