zoukankan      html  css  js  c++  java
  • Dialog(弹窗)

    Dialog一般用自定义的,系统自带的也有

    //系统自带Dialog
    AlertDialog.Builder b=new AlertDialog.Builder(Reign.this); b.setTitle("是否登录");//设置标题 b.setMessage("是否登录"); //设置内容 b.setPositiveButton("是", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Intent i = new Intent(); Bundle bundle=new Bundle(); i.setClass(Reign.this, Login.class); bundle.putSerializable("data", (Serializable) user); i.putExtras(bundle); startActivity(i); dialog.dismiss(); } }); b.setNegativeButton("否", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(Reign.this, "还是登录吧", Toast.LENGTH_SHORT).show(); dialog.dismiss();//销毁弹窗 } }); b.create().show();//先create,再show
        //
    b.setCancelable(true);点击空白处,是否消失弹窗,默认是true,消失
    
    

    //学了自定义在说

  • 相关阅读:
    IHttpHandler and HttpModule
    sql page reship
    prototype
    google search engine theory
    ghost
    sql split
    Missing you is a kind of my deeppain in my life
    file control
    a story of c#(reship)
    teacher and student(reship)
  • 原文地址:https://www.cnblogs.com/Xacm/p/5465940.html
Copyright © 2011-2022 走看看