public class TestActivity extends Activity {
private static String TAG = WebViewActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LogUtils.LOGD(TAG, "onCreate begin");
setContentView(R.layout.activity_test);
WebView view = (WebView)findViewById(R.id.fridge_webview_test);
view.getSettings().setJavaScriptEnabled(true);
String url = getIntent().getStringExtra("startUrl");
LogUtils.LOGD(TAG, "onCreate url = " + url);
if (url == null || url.trim().length() <= 0) {
return;
}
view.loadUrl(url);
}
}
<!--activity_test.xml>
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fridge_webview_test"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>