【Java开源代码栏目提醒】:网学会员鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“Web.java”一文,供大家参考学习
package com.example.android.Web;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class Web extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final String mimeType = "text/html";
final String encoding = "utf-8";
WebView web;
web = (WebView) findViewById(R.id.web1);
web.loadData("<a href='x'>Welcome Android World</a>", mimeType, encoding);
web = (WebView) findViewById(R.id.web2);
web.loadData("<a href='x'>Please click below Web Links:</a>", mimeType, encoding);
web = (WebView) findViewById(R.id.web3);
web.loadDataWithBaseURL("", "<a href='http://www.google.com'>www.google.com</a>", mimeType, encoding, "");
web = (WebView) findViewById(R.id.web4);
web.loadDataWithBaseURL("", "<a href='http://developer.android.com'>Android Developer</a>", "", "", "");
web = (WebView) findViewById(R.id.web5);
web.loadDataWithBaseURL("http://www.android.com/", "<a href='market'>Android Market</a>", mimeType, encoding, "Unable to link this web");
}
}
上一篇:
Weather.java
下一篇:
下鼻甲不同术式对鼻黏膜纤毛功能的影响