java - Check whether an activity is active or not from a different activity -
i have flow in application this:
for new users:
splash screen --> login activity --> home activity
for registered users:
splash screen --> home activity
basically splash screen has if else decide activity go to. 1 time first time user logs in, status saved in preference variable splash screen decide next time not open login activity.
now situation that. if new user logs in , goes home activity, , logs out. redirected login screen pretty much should happen. but, in case existing user opens app, shown splash screen , straight moved home activity. if user logs out, gets out of app. happens because login activity not have instance created , finishing home activity finishes whole app. logout finishes home activity, naturally lastly active activity should open up. not happening.
what want that, want implement logic check login activity available or not. if available finish()
called else login activity called via intent.
please tell me how accomplish this.
p.s: app uses custom theme customized action bar. if phone call finish , intent or utilize flags clear existing activities there weird transition effect shows black standard action bar split sec creating bad user experience.
when user login finish login activity , start home activity. when user logout finish home activity , start login activity
java android android-activity activity-lifecycle activity-finish
No comments:
Post a Comment