• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps displaying html characters in android view

kaancho

Newbie
hi
How do I display the HTML character in android view.
I get break tags "<br>" and "<p>" tags displaying in the view
 
ok,
I changed my view from "textview" to webview".
However, when i use loadData to set content inside a webview it comes up as blank.

Each webview is a row in a ListView if that helps.

Any idea what i need to do to fix this?
 
This is the layout.xml and the java.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView
android:id="@+id/sourceicon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>

WebView tt = (WebView)findViewById(R.id.sourceicon);

WebView webview = new WebView(this);
String summary = "<html><body>You scored <b>192</b> points.</body></html>";

webview.loadData(summary, "text/html", "utf-8");
 
Thanks fr your post, this solves one of a few of the problems I'm having with one of my next updates!
 
Back
Top Bottom