I have a mobile web site and a mobile app for Android that can load this web site in a webview. I’d like to set the HTTP ‘referer’ request header from the Android app so that I track what Android app users do.
I there any way to set the HTTP request headers before calling loadURL() in WebView ?
EDIT:
It turns out in Froyo (2.2) there is a way to do this as the loadUrl() command has a new parameter to specify extra headers WebView/loadUrl. The comments say you can’t override common headers, but I’ve tested ‘referer’ and it works fine.
So – still need a pre Froyo solution – any ideas ?
It is not possible pre Froyo. After Froyo you can use the extraHeaders parameter in loadUrl to pass HTTP headers.