Created
December 8, 2009 07:56
-
-
Save shaobin0604/251506 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package cn.yo2.aquarium.webviewtest; | |
| import android.app.Activity; | |
| import android.os.Bundle; | |
| import android.webkit.WebView; | |
| public class Main extends Activity { | |
| /** Called when the activity is first created. */ | |
| @Override | |
| public void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.main); | |
| String data = "<a href=\"http://sian.com/msnportal/redirectTitle.do?id=1\">中文 utf-8 编码</a>"; | |
| WebView webView1 = (WebView) findViewById(R.id.webview_1); | |
| webView1.loadData(data, "text/html", "utf-8"); | |
| WebView webView2 = (WebView) findViewById(R.id.webview_2); | |
| webView2.loadDataWithBaseURL("", data, "text/html", "utf-8", ""); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment