0
Errors I am getting when passing Html(textstring) content value to webview.loaddata(textstring , "text/html", "utf-8");

Works fine in gingerbread,jellybean etc....but facing problem in Ice cream sandwich....Please help me to solve this

02-08 13:52:56.899: W/webcore(1694): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
02-08 13:52:56.899: W/webcore(1694):    at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1671)
02-08 13:52:56.899: W/webcore(1694):    at android.webkit.WebViewCore$EventHub.access$7800(WebViewCore.java:920)
02-08 13:52:56.899: W/webcore(1694):    at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1783)
02-08 13:52:56.899: W/webcore(1694):    at android.webkit.WebView.sendOurVisibleRect(WebView.java:2858)
02-08 13:52:56.899: W/webcore(1694):    at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:586)
02-08 13:52:56.899: W/webcore(1694):    at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
02-08 13:52:56.899: W/webcore(1694):    at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:977)
5
  • 1
    possible duplicate: stackoverflow.com/questions/10512282/… Commented Feb 8, 2013 at 8:36
  • will you need to load some text using webview? Commented Feb 8, 2013 at 8:40
  • As per the link I have tried it all. But still getting this warning, thus it is opening in emulator but not in devices. Can you please tell me the reason for this bug. Why it is happening?????Because it is working fine in others devices Commented Feb 8, 2013 at 8:42
  • @TamilarasiSivaraj yes....HTML value....using asynctask getting that value and passing that value to the webview.loaddata(). Commented Feb 8, 2013 at 8:44
  • i post the answer that will work for me i hope also will work for you Commented Feb 8, 2013 at 8:47

1 Answer 1

2

Try this I this that will help to you

String data = ...;  // the html data
String base64 = android.util.Base64.encodeToString(data.getBytes("UTF-8"),  
android.util.Base64.DEFAULT);
webView.loadData(base64, "text/html; charset=utf-8", "base64");

and you try this also

   webView.getSettings().setDefaultTextEncodingName("utf-8");      
   webView.loadDataWithBaseURL(null, html, "text/html", "utf-8", null);

And also refer this link

UTF-8 encoding on WebView and ICS

Sign up to request clarification or add additional context in comments.

5 Comments

No...Still getting that warning. This is my HTML data <html><body>" + "<p align=\"justify\">" + "<font color='white' style='line-height:1.2em; font-style:italic;font-weight:bold;font-size:11px; font-family:Times New Roman' >"+textcastdet+"</font>" + "</p>" + "</body></html>
posting an answer is nice, but posting why you think the error occurs and how you think your solution helps is even better.
WebView wvtxtcastdet; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.filmdetailspg); wvtxtcastdet=(WebView)findViewById(R.id.webViewfilmdet); System.out.println("IM 3"); wvtxtcastdet.setBackgroundColor(0);
wvtxtcastdet.getSettings().setJavaScriptEnabled(true); wvtxtcastdet.getSettings().setPluginState(PluginState.ON); new CastdetAsync().execute(); Asynctask
hi ARIJIT i have edited my comment please see that and i hop that will be help to u

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.