package com.example.interfaces; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class MainActivity extends Activity { private WebView mWebview ; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.webview); mWebview = new WebView(this); mWebview.getSettings().setJavaScriptEnabled(true); // enable javascript final Activity activity = this; mWebview.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(activity, description, Toast.LENGTH_SHORT).show(); } }); mWebview .loadUrl("http://vimeo.com/98306475"); setContentView(mWebview ); } }
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <VideoView android:id="@+id/videoView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" /> </Relative
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)