zoukankan      html  css  js  c++  java
  • Android开发-- 简单对话框

     1 final Builder builder = new AlertDialog.Builder(this);
     2 builder.setIcon(R.drawable.appicns_folder_smart);
     3 builder.setTitle("Normal Dialog");
     4 builder.setMessage("A simple dialog");
     5 builder.setPositiveButton("OK", new OnClickListener() {
     6                     
     7     @Override
     8     public void onClick(DialogInterface arg0, int arg1) {
     9         toast.setText("User has clicked OK button.");
    10         toast.show();
    11         }
    12     });
    13                 
    14     builder.setNegativeButton("Cancel", new OnClickListener() {
    15                     
    16     @Override
    17     public void onClick(DialogInterface arg0, int arg1) {
    18         toast.setText("User has clicked Cancel button.");
    19         toast.show();
    20         }
    21     });
    22 builder.create().show();
  • 相关阅读:
    作业11
    作业10总结
    作业10
    作业9总结
    作业9
    作业8总结
    作业8
    实验7总结
    实验6总结
    史航第12次作业&总结
  • 原文地址:https://www.cnblogs.com/feiling/p/3993243.html
Copyright © 2011-2022 走看看