I’m trying to log in “vkontakte” from my android app with help of webview to enter password and get access_token. I must to hide webview just in the moment when I get access_token, not in button click or other user’s action. how can I do it? and i can’t using timer for it
Share
Use the webview’s onPageFinished event to find out when the page finished loading.
http://developer.android.com/reference/android/webkit/WebViewClient.html#onPageFinished(android.webkit.WebView, java.lang.String)
In the onPageFinished event you can collect the access_token and then hide the webview. I am not familiar with “vkontakte” and how it sends the access_token. Assuming the access_token comes in as a GET param, you can parse it out of the URL.