zoukankan      html  css  js  c++  java
  • 【一找客户端】提示框在该应用中的使用技巧,让代码更加美观

    一找客户端中大量使用了提示框。 针对较多的客户端需要一个合理的组织方式。

    在activity中有一个方法,showDialog(id).

    这里设置的id可以在该方法的onCreateDialog中进行设置。

    看代码:

     @Override
    protected Dialog onCreateDialog(int id) {
    switch (id) {

    case Const.DIALOG_YES_NO_MESSAGE:
    return new AlertDialog.Builder(_context)
    .setTitle("确定退出程序?")//设置对话框的标题
    .setPositiveButton("确定", new DialogInterface.OnClickListener() {//设置按下表示确定按钮时按钮的text,和按钮的事件监听器
    @Override
    public void onClick(DialogInterface dialog, int whichButton) {
    removeDialog(Const.DIALOG_YES_NO_MESSAGE);
    ATManager.exitClient(_context);
    }
    })
    .setNegativeButton("取消", new DialogInterface.OnClickListener() {//设置取消按钮的text 和监听器
    @Override
    public void onClick(DialogInterface dialog, int whichButton) {
    dialog.dismiss();
    }
    })
    .create();
    return null;



  • 相关阅读:
    fastdfs部署及官网
    fasrdfs在spring cloud中的使用
    面包屑的查询
    SpringCloud中使用ES使用课程上下线
    Redis中在项目中的使用
    树结构Tree查询
    平凡的世界 田晓霞的日记 摘抄

    英语积累
    英语学习第四天
  • 原文地址:https://www.cnblogs.com/xitang/p/2184945.html
Copyright © 2011-2022 走看看