Hi all,
I'm trying to fetch "surf" interactions from the WebViewClient though
overloading the shouldOverrideUrlLoading, it works fine for links <a
href="apa"> and for form posts that uses GET method. But when I change
the post method to POST its not notified by the
shouldOverrideUrlLoading method. Any suggestions on how to solve
this?
I have included test code to illustrate my issue
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class test extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create view
WebView webView = new WebView(this);
webView.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view,
String url)
{
System.out.println("shouldOverrideUrlLoading...
webview URL:" +
url);
return true;
}
});
String browserText = "<html><body><form method=\"post\"> <input
type=
\"submit\" value=\"Post Click!\"></form><form method=\"get\"> <input
type=\"submit\" value=\"Get Click!\"></form> <a href=\"index.html
\">link</a></body></html>";
webView.loadData(browserText,"text/html","utf8");
setContentView(webView);
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en