package com.html;
import com.sqlite.Dao.NcpRegisterDAO;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.Toast;
public class Register_protocolActivity extends Activity {
privateHandler mHandler = new Handler();
privateWebView mWebView;
privateNcpRegisterDAO dao = null;
public voidonCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//踩上一脚,记录有了就知道复位的时候要去哪里
dao = new NcpRegisterDAO(Register_protocolActivity.this);
String name = "MainActivity";
dao.add_Stepped(name);
//隐藏标题栏
//requestWindowFeature(Window.FEATURE_NO_TITLE);
//隐藏状态栏
//getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
//该ACTIVITY不需要layout设置,所以直接指向MainActivity的main
setContentView(R.layout.protocol);
//将WebView实例化
mWebView = (WebView) this.findViewById(R.id.webView);
//WebView打开权限
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
mWebView.getSettings().setJavaScriptEnabled(true);
//WebView,SWF文件运行权限
mWebView.getSettings().setPluginsEnabled(true);
mWebView.addJavascriptInterface(new Action(), "ncp");
mWebView.loadUrl("file:///android_asset/protocol.html");
// 创建WebViewChromeClient
WebChromeClient wvcc = new WebChromeClient() {
// 处理Alert事件
import com.sqlite.Dao.NcpRegisterDAO;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.Toast;
public class Register_protocolActivity extends Activity {