My webview in my application does not show up. I went to the interwebs to find an answer, but I found nothing, just tutorials on how to use the control. I am trying to load a html file, but it is not showing.
I added the user permission 'Internet' to my manifest.
Here is my layout:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dip"
android:visibility="visible" >
<WebView
android:id="@+id/wvInfo"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</TableRow>
</TableLayout>
I have a file, 'filename.html' in my assets folder.
The following code is in the onCreate:
WebView wvinfo = (WebView) findViewById(R.id.wvInfo);
wvinfo.loadUrl("file:///android_asset/filename.html");
When I load the program on my phone, nothing shows up. I also tried to load an url, "http://www.google.com" and still nothing shows. I am stumped. Any ideas?
loadData(html, "text/html", null);. You could also show us the manifest, or the parts you edited.