android 对话框显示工具类

这个工具类非常简单,但是将显示dialog的方法统一封装,能够大大减少代码重复

package com.ctbri.weather.utils;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;

public class ShowDialogActivity{

    public static void showDialog(Context con){
        Dialog dialog = new AlertDialog.Builder(con)
        .setTitle("����")
        .setMessage("�������,��������������")
        .setPositiveButton("ȷ��", null).create();
        dialog.show();
    }

    public static ProgressDialog showPgDialog(Context con,String msg){
        ProgressDialog pd = new ProgressDialog(con);
        pd.setMessage(msg);
        return pd;
    }
    public static void dialog(Context con,String title,String msg){
        Dialog dialog = new AlertDialog.Builder(con)
        .setTitle(title)
        .setMessage(msg)
        .setPositiveButton("ȷ��", null).create();
        dialog.show();
    }
    
}

 

posted @ 2013-07-12 09:38  bobo的学习笔记  阅读(556)  评论(0编辑  收藏  举报