WEB开发网
开发学院手机开发Android 开发 Android WebView的使用 阅读

Android WebView的使用

 2010-07-19 23:13:00 来源:WEB开发网   
核心提示:JsResult result){//构建一个Builder来显示网页中的alert对话框Builder builder = new Builder(Test.this);builder.setTitle("提示对话框");builder.setMessage(message);builder.se
JsResult result){

//构建一个Builder来显示网页中的alert对话框

Builder builder = new Builder(Test.this);

builder.setTitle("提示对话框");

builder.setMessage(message);

builder.setPositiveButton(android.R.string.ok, new AlertDialog.OnClickListener(){

@Override

public void onClick(DialogInterface dialog, int which) {

// TODO Auto-generated method stub

result.confirm();

}

});

builder.setCancelable(false);

builder.create();

builder.show();

return true;

}

public boolean onJsConfirm(WebView view,String url,String message,final JsResult result){

Builder builder = new Builder(Test.this);

builder.setTitle("带选择的对话框");

builder.setMessage(message);

builder.setPositiveButton(android.R.string.ok, new AlertDialog.OnClickListener(){

@Override

public void onClick(DialogInterface dialog, int which) {

// TODO Auto-generated method stub

result.confirm();

}

});

builder.setNeutralButton(android.R.string.cancel, new AlertDialog.OnClickListener(){

@Override

public void onClick(DialogInterface dialog, int which) {

// TODO Auto-generated method stub

result.cancel();

}

});

builder.setCancelable(false);

builder.create();

builder.show();

return true;

}

public boolean onJsPrompt(WebView view,String url,String message,String defaultValue,final JsPromptResult result){

LayoutInflater inflater = LayoutInflater.from(Test.this);

final View v = inflater.inflate(R.layout.prom_dialog, null);

//设置 TextView对应网页中的提示信息

((TextView)v.findViewById(R.id.TextView_PROM)).setText(message);

上一页  1 2 3 4 5 6 7 8  下一页

Tags:Android WebView 使用

编辑录入:coldstar [复制链接] [打 印]
赞助商链接