activity-lifecycle

On logout, clear Activity history stack, preventing “back” button from opening logged-in-only Activities

雨燕双飞 提交于 2019-11-26 01:36:42
问题 All activities in my application require a user to be logged-in to view. Users can log out from almost any activity. This is a requirement of the application. At any point if the user logs-out, I want to send the user to the Login Activity . At this point I want this activity to be at the bottom of the history stack so that pressing the \"back\" button returns the user to Android\'s home screen. I\'ve seen this question asked a few different places, all answered with similar answers (that I

what exactly Activity.finish() method is doing?

☆樱花仙子☆ 提交于 2019-11-26 00:23:39
问题 I\'m developing android applications for a while, and followed a lot of posts about activity life cycle, and application\'s life cycle. I know Activity.finish() method calls somewhere in the way to Activity.onDestroy() , and also removing the activity from stack, and I guess it somehow points to operating system and garbage collector that he can \"do his trick\" and free the memory when it find it a good time doing so.... I came to this post - Is quitting an application frowned upon? and read

Removing an activity from the history stack

我的梦境 提交于 2019-11-26 00:08:41
问题 My app shows a signup activity the first time the user runs the app, looks like: ActivitySplashScreen (welcome to game, sign up for an account?) ActivitySplashScreenSignUp (great, fill in this info) ActivityGameMain (main game screen) so the activities launch each other in exactly that order, when the user clicks through a button on each screen. When the user goes from activity #2 to #3, is it possible to wipe #1 and #2 off the history stack completely? I\'d like it so that if the user is at