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

Android WebView的使用

 2010-07-19 23:13:00 来源:WEB开发网   
核心提示://设置EditText对应网页中的输入框((EditText)v.findViewById(R.id.EditText_PROM)).setText(defaultValue);Builder builder = new Builder(Test.this);builder.setTitle("带输入的对话

//设置EditText对应网页中的输入框

((EditText)v.findViewById(R.id.EditText_PROM)).setText(defaultValue);

Builder builder = new Builder(Test.this);

builder.setTitle("带输入的对话框 ");

builder.setView(v);

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

@Override

public void onClick(DialogInterface dialog, int which) {

// TODO Auto-generated method stub

String value = ((EditText)v.findViewById(R.id.EditText_PROM)).getText().toString();

result.confirm(value);

}

});

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

@Override

public void onClick(DialogInterface dialog, int which) {

// TODO Auto-generated method stub

result.cancel();

}

});

builder.setOnCancelListener(new DialogInterface.OnCancelListener(){

@Override

public void onCancel(DialogInterface dialog) {

// TODO Auto-generated method stub

result.cancel();

}

});

builder.create();

builder.show();

return true;

}

//设置网页加载的进度条

public void onProgressChanged(WebView view,int newProgress){

Test.this.getWindow().setFeatureInt(Window.FEATURE_PROGRESS, newProgress*100);

super.onProgressChanged(view, newProgress);

}

//设置应用程序的标题

public void onReceivedTitle(WebView view,String title){

Test.this.setTitle(title);

super.onReceivedTitle(view, title);

}

});

btn.setOnClickListener(new Button.OnClickListener(){

@Override

public void onClick(View v) {

// TODO Auto-generated method stub

String url = et.getText().toString();

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

Tags:Android WebView 使用

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