In my application, I need to implement password validation. I would like to create a modal activity which cannot be escaped to go inside the app unless password is provided. The tricky part is that there are other threads running in the app, which connects to server and starts various other activities on successful connection. This situation causes other activities to start even when the user is still on the password validation screen.

I am looking for a solution where within my application Validation activity is a modal activity and hence always reside on top until finished programmatically.

Is there a Intent flag or some logic which will allow this password validation activity to stay on top always. I am open to analyze any security framework available which will allow me to do this.