I'm programming a Voting Android Application. After the user has chosen an Election where he wants to make a vote, the user gets redirected to a Login Activity where he has to enter a password. After that, a Ballot Activity gets started and the person can choose some candidates. A requirement in this project is, that if the application leaves the foreground (onPause()) and enters the foreground back later (onResume()), the login screen should return and ask the user for his credentials again. How does one realize that? I saw some solutions at stackoverflow with android:clearTaskOnlaunch="true", but this does only work if the login screen is the root activity, which in my case is not true. Can someone help me out? Thank you.I'm programming a Voting Android Application. A