0

I have an URL for a blog site and I load it from my Android app like this

 webView = (WebView) findViewById(R.id.webview);
 webView.getSettings().setJavaScriptEnabled(true);
 webView.getSettings().setLoadWithOverviewMode(true);
 webView.getSettings().setUseWideViewPort(true);
 webView.loadUrl(myURL);
 webView.setWebViewClient(new CustomWebViewClient());

CustomWebViewClient class

 private class CustomWebViewClient extends WebViewClient {

    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        super.onPageStarted(view, url, favicon);
        showProgressDialog(BrowserActivity.this);
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        hideProgressDialog(BrowserActivity.this);
    }
}

The site loads and it displays some images on 2 rows. If I open the blog from my phone browser and scroll the page to the end, more images are loaded automatically. So the problem is that if the blog is opened from my app it shows only 2 rows and it doesn't load the rest of the images. What can be the problem? How could I fix this?

Laura
  • 2,653
  • 7
  • 37
  • 59
  • Maybe an Ajax problem on the blog page, take a look at http://stackoverflow.com/questions/14191338/ajax-working-on-some-android-devices-not-in-other webView.getSettings().setAllowUniversalAccessFromFileURLs(true); – bviale May 15 '15 at 09:07
  • This doesn't work either. Maybe there's nothing I can do on my side. – Laura May 15 '15 at 09:33

2 Answers2

0
 webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);

or use in xml file

<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"    >
  <WebView
    android:id="@+id/mywebview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbars="none" />
</ScrollView>

in Java file

webview.setScrollContainer(false);
Chirag Savsani
  • 6,020
  • 4
  • 38
  • 74
0

Enable the DOM storage and see if it helps:

webView.getSettings().setDomStorageEnabled(true);
waqaslam
  • 67,549
  • 16
  • 165
  • 178