Android add HTML content to webview without spaces

I am trying to add HTML content to a web view. If the words in the HTML content do not have spaces, webview keeps that particular word on the same line. I want this content to be wrapped and on the next line. Is it possible to do this. I am adding some sample code that can reproduce the problem.

  String temp="<p>WebViewallowsyoutocreateyourownwindowforviewingwebpages(orevendevelopacompletebrowser).Inthistutorial,youcreateasimpleActivitythatcanviewandnavigatewebpages.1.CreateanewprojectnamedHelloWebView.</p>";
             WebView wb=new WebView(this);
             wb.loadDataWithBaseURL("", temp, "text/html", Encoding.UTF_8.toString(),""); 
             setContentView(wb);

      

+2


a source to share


1 answer


Try to use the correct html tags, I think because you only used the paragraph it keeps scrolling horizontally.



+1


a source







All Articles