I am working on an application that launches browser activity to authorize Twitter OAuth. This process uses a callback URL that re-launches the activity, which first launches the activity of the browser.
My problem is that the browser pages remain on the history stack, and when the user then discards from the activity the preferences that launched the browser in the first place, they do not return to the main action of the application, but instead are returned to the browser. I tried adding flags to the launch intent to prevent history and reset on clarity, but it doesn't seem to work when working on my phone, only on emulators.
Here is the code I use to trigger browser activity:
Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)); webIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); webIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); webIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); ctx.startActivity(webIntent);
Can anyone understand what might be wrong?
android
jaredbro
source share