日期:2014-05-17 浏览次数:20931 次
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Android.Webkit;
namespace Sentry
{
[Activity(Label = "Sentry968", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
WebView VW = FindViewById<WebView>(Resource.Id.webView1);
myWVC Wvc = new myWVC();
VW.SetWebViewClient(Wvc);
VW.LoadUrl("http://xxxxxxxx/");
}
}
class myWVC : WebViewClient
{
public override bool ShouldOverrideUrlLoading(WebView view, string url)
{
switch (url)
{
case "button://cmdExit_Click/":
System.Environment.Exit(0);
break;
}
return base.ShouldOverrideUrlLoading(view, url);
}
}
}