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)
ARIJIT
  • 515
  • 8
  • 22
  • 1
    possible duplicate: http://stackoverflow.com/questions/10512282/android-eventhub-removemessagesint-what-107-is-not-supported-before-the-we – Veaceslav Gaidarji Feb 08 '13 at 08:36
  • will you need to load some text using webview? – Android_coder Feb 08 '13 at 08: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 – ARIJIT Feb 08 '13 at 08:42
  • @TamilarasiSivaraj yes....HTML value....using asynctask getting that value and passing that value to the webview.loaddata(). – ARIJIT Feb 08 '13 at 08:44
  • i post the answer that will work for me i hope also will work for you – Android_coder Feb 08 '13 at 08:47

1 Answers1

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

Community
  • 1
  • 1
Android_coder
  • 9,953
  • 3
  • 17
  • 23
  • No...Still getting that warning. This is my HTML data " + "

    " + ""+textcastdet+"" + "

    " + "
    – ARIJIT Feb 08 '13 at 08:51
  • posting an answer is nice, but posting why you think the error occurs and how you think your solution helps is even better. – njzk2 Feb 08 '13 at 08:57
  • 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); – ARIJIT Feb 08 '13 at 09:17
  • wvtxtcastdet.getSettings().setJavaScriptEnabled(true); wvtxtcastdet.getSettings().setPluginState(PluginState.ON); new CastdetAsync().execute(); Asynctask – ARIJIT Feb 08 '13 at 09:18
  • hi ARIJIT i have edited my comment please see that and i hop that will be help to u – Android_coder Feb 08 '13 at 10:02