i wouldn't necessarily advise replacing the user agent string completely, as other pieces in the chain might become confused. it's also possible that at request time WebKit is rejecting your string and sending the default one.

if i'm reading it correctly, the standard for user agent strings specifies space-separated tokens. hence i get the current user agent string, then append a space and my keyword. my rails app picks up the key and does the right thing.

works fine for me!

hth


I am working on an application where I need to change the UserAgent
string of the browser:

WebView webview = new WebView(this);
        String newUA = "Foo-Bar/";
        webview.getSettings().setUserAgentString(newUA);
        setContentView(webview);

When I call:
webview.getSettings().getUserAgentString()
the application returns "Foo-Bar/" as the UserAgent, but when I load a
url that specifically tells me the User Agent String:
webview.loadUrl("http://myurl.com";);

The browser is announcing itself with the default UserAgent string.

Any ideas?

Thanks
Doug

--
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


--
jason.vp.engineering.particle

--
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

Reply via email to