【发布时间】:2014-12-16 20:36:44
【问题描述】:
您好,我已经尝试了很多教程并检查了 stackoverflow,但我遇到了问题。自定义 html webview 不会自动查看,您必须单击 android 手机的后退按钮,然后他才能查看他。 有人可以帮忙吗?
webView = (WebView) findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setSupportZoom(true);
webView.setBackgroundColor(Color.parseColor("#9e1b32"));
String customHtml = "<html><body><h1>Hello, WebView</h1></body></html>";
webView.loadData(customHtml, "text/html", "UTF-8");
和列表视图换页器:
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
switch (position)
{
case 0:
Intent newActivity0 = new Intent(getBaseContext(), 1.class);
startActivity(newActivity0);
case 1:
Intent newActivity1 = new Intent(getBaseContext(), 2.class);
startActivity(newActivity1);
}
【问题讨论】: