I have such a situation. I have Activity A, which sends the intention to create Activity B, which is the browser for authenticating the user with his Twitter account. When the credentials are transferred, the control returns to Activity A again, and I can continue to navigate through the application. However, if users leave the application, browser activity resumes, forcing the user to close the browser.
The problem is that I would like to remove browser activity from the stack after receiving the credentials for authentication.
Do you know if this is possible? I can not use startActivityForResult, since authentication must be done in the browser, I have no control over this action. Thank you very much
EDIT:
I start work as follows:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)).setFlags(Intent.FILL_IN_ACTION));
source share