package c.c; import android.os.Bundle; import android.webkit.WebView; import android.app.Activity; public class MainActivity extends Activity { private WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mWebView=(WebView) findViewById(R.id.webView); String url = "file:///android_asset/test.html"; mWebView.getSettings().setDefaultTextEncodingName("gbk"); mWebView.loadUrl(url); } }
时间: 2024-09-19 12:31:23