WebView加载本地HTML
[java]
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);
}
}
补充:移动开发 , Android ,