Note that there are some explanatory texts on larger screens.

plurals
  1. POMobile site in webview doesn't work
    primarykey
    data
    text
    <p>Well i'm working for a simple webview to display a website of course..this website has a mobile version but when i try to run the application the webview displays the desktop mode. I tryied every way but nothing seems to work.. I tryied to change the user agent but nothing.. This is the part of user agent i'm using now</p> <pre><code>webView.getSettings().setUserAgentString("Mozilla/5.0 (Linux; U;` Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"); </code></pre> <p>Of course doesn't work. </p> <p>Another one (doesn't work)</p> <pre><code>webview.getSettings().setUserAgentString("Mozilla/5.0 (Linux; Android 4.2.2; Nexus 7Build/JRO03D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19"); </code></pre> <p>And many others but none works. What can i do?</p> <p>EDIT with my code</p> <pre><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 like Mac OS X; en)AppleWebKit/420+ (KHTML, like 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/"); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload