您可以使用webview的setWebViewClient方法,然后实现一个新的webViewClient,然后您可以使用onPageFinished方法访问完整的URL。看下面的代码。
webView.setWebViewClient(new WebViewClient()
{
@Override
public void onPageFinished(WebView view, String url)
{
if (url.contains("#access_token=")) //I am looking for #access_token= hash, you can look for any parameter here
{
String accessToken = url.substring(url.indexOf("#access_token=") + 14, url.length()); //14 is my "#access_token=" length, yours will be different
writeAccessTokenToFile(accessToken); //this method is your method
loadApplication(); //then load you application logic, this is your method too
}
}
});
非常感谢.. :) – Anu 2011-04-25 05:58:54
但是这种方法似乎只适用于android开发人员。 :( – Anu 2011-04-25 06:14:51
你是对的,这是为了android开发,你在服务器端Java开发中使用了什么框架? – 2011-04-25 09:48:46