1

I am trying to load a webpage using a webview

String url = intent.getStringExtra("url");  

WebView myWebView = (WebView) findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
//webSettings.setJavaScriptEnabled(true);
webSettings.setBuiltInZoomControls(true);
//myWebView.loadUrl(url);
myWebView.loadUrl(url);

This is my current code, however the webpage is not resized in any way.

If I load the same webpage using a browser in the emulator, the webpage is resized and shown correctly. Can someone help me?

myWebView.setInitialScale(50); This helps and resizes the webpage however there is still a small part of the webpage on the left missing.

Is this the correct solution: How to create an android webview that is the same as the android default browser?

Has someone done something different?

It now load the webpage as I want to but then it has too mush white space. The text is all cramped up in 1 column and doesn't spread over the page.

Community
  • 1
  • 1
Angelking
  • 47
  • 7
  • possible duplicate of [How to set the initial zoom/width for a webview](http://stackoverflow.com/questions/3808532/how-to-set-the-initial-zoom-width-for-a-webview) – njzk2 Jun 10 '13 at 16:18

2 Answers2

0

Try below code,

myWebView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
Basim Sherif
  • 5,384
  • 7
  • 48
  • 90
  • This doesn't help as it mangles everything into 1 column. Atleast previously it loaded the page correctly but I could only see half the page. – Angelking Jun 10 '13 at 11:32
-1

try this one

myWebView.setInitialScale(1);
Sunil Kumar
  • 7,086
  • 4
  • 32
  • 50
  • Using this I just get a tiny box at the top of the page which I believe is the whole page scaled down to 1 pixel. – Angelking Jun 10 '13 at 11:48