全速加载中

Android开发学习笔记-显示对话框

private void ShowUpdateDialog() {
    Log.i("version", "shengji");
        AlertDialog.Builder dialog = new Builder(this);
        dialog.setTitle("提醒升级");
        dialog.setMessage("是否进行升级?");
        dialog.setPositiveButton("立刻升级", new OnClickListener() {
            
            @Override
            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub
                
            }
        });
        dialog.setNegativeButton("暂不升级", new OnClickListener() {
            
            @Override
            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub
                dialog.dismiss();
                ShowMainActivity();
            }
        });
        dialog.show();
    }

 

posted @ 2014-10-06 23:15  许鸿飞  阅读(192)  评论(0编辑  收藏  举报