I have MAIN Activity and WEB activity with webView. MAIN always performs some processing and redirects automatically to WEB.
When on WEB I enter Preferences, make preference changes and when I press Back I return to WEB. However, in preferences I can also preform an account deletion and that will perform account deletion and start MAIN which again will start WEB automatically but this time, since the account was deleted, in a different webView (registration).
PROBLEM: When on registration after account deletion, if I press Back I return to my (deleted) account, meaning to the webView from which I have entered preferences to delete the account.
In the preferences Fragment, if account delete, I start MAIN with Intent and add the followings:
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
getActivity().finish();
but it doesn't help.
I have also tried clearing webView cache and history and it doesn't help either.
I have considered adding
android:noHistory="true"
to the manifest but as I said, when I just change preferences I still want to be able to return to previous activity.
Any ideas what should I do?