android - WebView displays black screen -
I'm a little embarrassed to post it but I do not know where I am wrong. I have seen every example and every tutorial, and everything looks right for me. What I am doing here. I have a list view that when you click on an item, it will take you to a webview which lists Displays some static formatted text associated with the entry.
I was working with all this with a TextView but I wanted to be able to use HTML formatting for text and felt that WebView was the way to go. Right now it is considered to display a normal link for testing purposes only, but when the visual communication starts, it only goes to a black screen. I can go back and get another entry and it also shows only black screen. .
I'm not sure what code you want to see, here is a visual view class file and view section.XML layout.
viewSection.java:
import android.app.activity; Importroid.os.Bundle; Import android.webkit.WebView; Expands the expansion of public squared activity (/ ** calls are made when activity is created first. * / @ Override Crate on Public Zero (Bundle Saved Instantstate) {Supercontent (Saved Instantstate); WebView wv ; SetContentView (R.layout.viewsection); Wv = (webview) Find VVBIID (RaidV1); Wv.loadData ("& lt; a href = 'x' & gt; Hello World! - 1 & lt ; / A & gt; "," text / html "," utf-8 ");}}
viewsection.xml:
& lt ?; Xml version = "1.0" encoding = "Ut F-8 "? & Gt; LinearLayout xmlns: Android =" http://schemas.android.com/apk/res/android "android: orientation =" vertical "Android: layout_width =" wrap_content "Android: layout_height = "Wrap_content" & gt; WebView Android: id = "@ + id / wv1" Android: layout_height = "wrap_content" Android: layout_width = "fill_parent" />
You probably want to set android: layout_height
Go to Code> WebView to fill_parent
. I'm not sure that supports WebView
wrap_content
.
Edit : You can also type fill_parent
.
In addition, if you are using a very light HTML style, you can still use a TextView; Samples are samples in the app, how to do it (ie).
Comments
Post a Comment