Android: i am using twitter authentication by launching webview
Intent authIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));
startActivity(authIntent);
after successfull authentication onNewintent get call and control returns to my activity.
problem is webview still remain open after control return to my activity and if user press back button user can access that page again, how can i finish webview activity after control return to my actiivyt.
i would like to call finish on “authIntent” how can i ?
I preferred to launch the webview into a custom dialog and that way get full control over it. This includes using a WebView with a custom WebViewClient where the callback from authorization is handled in overridden shouldOverrideUrlLoading method.
For a detailed example, you could check the FacebookSDK and how it handles the authorization page in a dialog: it’s a bit too much code to be pasted here.