3

I am loading a local HTML document kept in assets folder into a WebView. It is showing fine in 2.3 devices but, showing blank screen in ICS + devices.

Akshay
  • 2,506
  • 4
  • 34
  • 55
Manjunath
  • 2,063
  • 2
  • 29
  • 60
  • can you share some code? as that can prove to be helpful to know what exactly may be the reason..your problem statement is clear. – Sanjay D Oct 31 '12 at 10:28
  • @SanjayD, This is the code I have used: gWebView = (WebView) findViewById(R.id.gWebView); WebSettings webSettings = gWebView.getSettings(); webSettings.setJavaScriptEnabled(true); gWebView.loadUrl("file:///android_asset/index.html"); – Manjunath Oct 31 '12 at 10:30

3 Answers3

6

Try using this code

webView.getSettings().setPluginsEnabled(true);
webView.getSettings().setAllowFileAccess(true);

As per my knowledge flash url do not work in ICS.

Sagar Patil
  • 1,400
  • 15
  • 29
0

This code should work

webView.getSettings().setPluginsEnabled(true);
webView.getSettings().setAllowFileAccess(true);
webView.loadUrl(url);
weevils.setJavascriptEnabled(true);

Also check that the internet permission in declared in your manifest.xml And take a look at this thread which is quite similar: Android Webview not rendering correctly on ICS 4.0 +

Community
  • 1
  • 1
Buneme Kyakilika
  • 1,202
  • 3
  • 13
  • 34
  • @Manjunath How is it not working. Are you getting errors? Can you copy+paste your logcat. – Buneme Kyakilika Oct 31 '12 at 12:23
  • It doesn't give error. It works like a champ in 2.3 version. But, shows blank in ICS. I tested on HTC Nexus one(works) and Galaxy Nexus(doesn't work)(It has Jelly Bean). – Manjunath Oct 31 '12 at 13:34
0

try adding this code if the above answer does not solve the problem

webView.getSettings().setBuiltInZoomControls(false);

I an not too sure on this though.

Sanjay D
  • 265
  • 4
  • 17