开发者

how to repeat activity in android?

开发者 https://www.devze.com 2023-03-16 16:11 出处:网络
I have more than one that\'s are splashActivity, mainActivity, etc. In beginning of installing application it start activity at spl开发者_JAVA技巧ashActivity, but if web click application icon it didn

I have more than one that's are splashActivity, mainActivity, etc. In beginning of installing application it start activity at spl开发者_JAVA技巧ashActivity, but if web click application icon it didn't start at splashActivity anymore, it stared directly into mainActivity.

How to set every starting application it will start at splashActivity?


You can set the activity attribute noHistory to true in your manifest, like so: android:noHistory="true" Read: http://developer.android.com/guide/topics/manifest/activity-element.html#nohist With noHistory set to true, your activity will not be stored on the application stack and by setting it to true for all your activities, the application is forced to start from the first activity. See also: Removing an activity from the history stack


What probably has happened is that your application hasn't closed, but sent to background. When you start it again, it actually doesn't start again, but it is brought into foreground. This is standard behaviour and you shouldn't try to change it.

0

精彩评论

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