2011-07-28 96 views

回答

1

您很可能希望使用WebView与链接的嵌入式视频超链接指向。

大意如下的东西线:

<LinearLayout ... > 
    ... my content 
    <WebView android:id="@+id/webView1" ... > 
     ... 
    </WebView> 
</LinearLayout> 

然后使用下面的钩子代码(大多来自网页视图文档):

WebView webview = (WebView) activity.getViewById(R.id.webView1); 

// Simplest usage: note that an exception will NOT be thrown 
// if there is an error loading this page (see below). 
webview.loadUrl("http://slashdot.org/"); 

// OR, you can also load from an HTML string: 
String summary = "<html><body>You scored <b>192</b> points.</body></html>"; 
webview.loadData(summary, "text/html", "utf-8"); 
// ... although note that there are restrictions on what this HTML can do. 
// See the JavaDocs for loadData() and loadDataWithBaseURL() for more info. 

不要忘记

<uses-permission android:name="android.permission.INTERNET" /> 

在清单中。