Android Login Screen after Application enters foreground again. Login Screen is NOT root Activity -
i'm programming voting android application. after user has chosen election wants make vote, user gets redirected login activity has enter password. after that, ballot activity gets started , person can choose candidates. requirement in project is, if application leaves foreground (onpause()) , enters foreground later (onresume()), login screen should return , ask user credentials again. how 1 realize that? saw solutions @ stackoverflow android:cleartaskonlaunch="true", work if login screen root activity, in case not true. can me out? thank you.
p.s: i'm sorry bad english, i'm not native speaker.
you need call finish() everytime launch loginactivity or ballotactivity.
private void go2login(){ intent = new intent (ballotactivity.this, loginactivity.class); startactivity(i); finish(); } void onpause(){ go2login(); }
but think not design. user angry if has enter password everytime app pauses. think should store password in preferences instead.
Comments
Post a Comment