java - Mobile site in webview doesn't work -


well i'm working simple webview display website of course..this website has mobile version when try run application webview displays desktop mode. tryied every way nothing seems work.. tryied change user agent nothing.. part of user agent i'm using now

webview.getsettings().setuseragentstring("mozilla/5.0 (linux; u;` android 2.0; en-us; droid build/esd20) applewebkit/530.17 (khtml, gecko) version/4.0 mobile safari/530.17"); 

of course doesn't work.

another 1 (doesn't work)

webview.getsettings().setuseragentstring("mozilla/5.0 (linux; android 4.2.2; nexus 7build/jro03d) applewebkit/535.19 (khtml, gecko) chrome/18.0.1025.166 safari/535.19"); 

and many others none works. can do?

edit code

@override     public void oncreate(bundle savedinstancestate)     {         super.oncreate(savedinstancestate);         getwindow().requestfeature(window.feature_indeterminate_progress); // request     progress circle         setcontentview(r.layout.main);         webview = (webview) findviewbyid(r.id.webview);         websettings websettings = webview.getsettings();         websettings.setjavascriptenabled(true);          webview.getsettings().setuseragentstring("mozilla/5.0 (iphone; u; cpu mac os x; en)applewebkit/420+ (khtml, gecko) version/3.0 mobile/1a543a safari/419.3");         setprogressbarindeterminatevisibility(true); // show progress circle          final activity activity = this;          webview.setwebchromeclient(new webchromeclient(){                  public void onprogresschanged(webview view, int progress) {                     activity.settitle("loading...");                     activity.setprogress(progress * 100);                     if(progress == 100)                         setprogressbarindeterminatevisibility(false); // hide progress circle when page loaded                     activity.settitle("title");                 }             });         if (savedinstancestate == null)         {             webview.loadurl("http://forum.ubuntu-it.org/");         }       } 

use following snippet hope work

 webview.getsettings().setuseragentstring("mozilla/5.0 (iphone; u; cpu mac os x; en)applewebkit/420+ (khtml, gecko) version/3.0 mobile/1a543a safari/419.3"); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -