M MDEnt Member Licensed User Longtime User Dec 14, 2011 #1 Wondering if anyone else has tried or is having a problem loading the Twitter website in a WebView. It just shows a blank page. I have tried to regular site twitter.com and the mobile site with mobile.twitter.com with both http and https. It loads fine in Dolphin,Firefox, for Android, etc. Is the WebView missing something that Twitter needs to display?
Wondering if anyone else has tried or is having a problem loading the Twitter website in a WebView. It just shows a blank page. I have tried to regular site twitter.com and the mobile site with mobile.twitter.com with both http and https. It loads fine in Dolphin,Firefox, for Android, etc. Is the WebView missing something that Twitter needs to display?
pluton Active Member Licensed User Longtime User Dec 14, 2011 #2 Hi MDEnt You are right. If you just go with your webview on m.twitter.com or mobile.twitter.com you will get this: But if you set User Agent String you will get normal site Code: Copy Dim Obj1 As Reflector Obj1.Target = Web 'name of your webview Obj1.Target = Obj1.RunMethod("getSettings") Obj1.RunMethod2("setUserAgentString", "Android 2.2", "java.lang.String") Don't forget to add Reflection library Upvote 0
Hi MDEnt You are right. If you just go with your webview on m.twitter.com or mobile.twitter.com you will get this: But if you set User Agent String you will get normal site Code: Copy Dim Obj1 As Reflector Obj1.Target = Web 'name of your webview Obj1.Target = Obj1.RunMethod("getSettings") Obj1.RunMethod2("setUserAgentString", "Android 2.2", "java.lang.String") Don't forget to add Reflection library
warwound Expert Licensed User Longtime User Dec 14, 2011 #3 You can also use my WebViewSettings library to set the user agent string. Martin. Upvote 0
M MDEnt Member Licensed User Longtime User Dec 14, 2011 #4 Ah nice. Thanks to both. It's my first time using a webview. Is it recommended to set the user agent string for any webview - even if the page is already showing up correctly? Upvote 0
Ah nice. Thanks to both. It's my first time using a webview. Is it recommended to set the user agent string for any webview - even if the page is already showing up correctly?
warwound Expert Licensed User Longtime User Dec 14, 2011 #5 MDEnt said: Ah nice. Thanks to both. It's my first time using a webview. Is it recommended to set the user agent string for any webview - even if the page is already showing up correctly? Click to expand... No i'd say not. If the web page loads correctly without modifying the user agent string then no need to bother. Martin. Upvote 0
MDEnt said: Ah nice. Thanks to both. It's my first time using a webview. Is it recommended to set the user agent string for any webview - even if the page is already showing up correctly? Click to expand... No i'd say not. If the web page loads correctly without modifying the user agent string then no need to bother. Martin.
M MDEnt Member Licensed User Longtime User Dec 14, 2011 #6 Thanks for the info - I've now tried to do a viewbiew with linkedin's new mobile site with no luck - using the user agent - this one hangs on a blank screen - loads fine in dolphin etc. m.linkedin.com Upvote 0
Thanks for the info - I've now tried to do a viewbiew with linkedin's new mobile site with no luck - using the user agent - this one hangs on a blank screen - loads fine in dolphin etc. m.linkedin.com