android弹出对话框

来源:互联网 发布:电极 cnc 编程 编辑:程序博客网 时间:2024/05/13 16:18

以下摘自:http://php.11519.net/adeve/?p=4

public void QuitApp() {
        
new AlertDialog.Builder(Hello.this).setTitle("提示"
).setMessage(
                
"确定退出?").setIcon(R.drawable.quit).setPositiveButton("确定"
,
                
new
 DialogInterface.OnClickListener() {
                    
public void onClick(DialogInterface dialog, int
 whichButton) {    
                         billdb.close();
                         finish();
                     }
                 }).setNegativeButton(
"取消"
,
                
new
 DialogInterface.OnClickListener() {
                    
public void onClick(DialogInterface dialog, int
 whichButton) {
                     }
                 }).show();

     }

///////////////////////////////////////////////////////

Toast.makeText(Hello.this,"提示信息:",Toast.LENGTH_LONG).show();