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"
/>

相关文章:

  • 2021-05-16
  • 2021-08-29
  • 2021-07-18
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2021-06-25
猜你喜欢
  • 2022-01-05
  • 2021-07-17
  • 2021-12-05
  • 2022-12-23
  • 2021-12-02
  • 2021-07-12
  • 2022-01-07
相关资源
相似解决方案