webview - Cannot get web view to work on Android sdk 1.6 -
i blank screen when try fill web view on android. program runs out errors, blank screen. i'm ussin g sdk 1.6 , running in simulator
the code package mikenorman.org;
import android.app.activity; import android.view.*; import android.os.bundle; import android.view.view; import android.webkit.webview; public class cblog extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.blog); webview mwebview; mwebview=(webview) findviewbyid(r.id.bwebpage); mwebview.loadurl("http://www.besttechsolutions.biz"); }
the layout file
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <webview android:id="@+id/bwebpage" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
} } -ted
change linear layout "fill_parent" instead of "wrap-content"
also should add </linearlayout>
bottom of layout file. linear layout never closed.
Comments
Post a Comment