protected Dialog onCreateDialog(int id) { switch(id) { case 1: { ProgressDialog checkUpdateIng = new ProgressDialog(CallPlayer.this); checkUpdateIng.setTitle("正在下载"); checkUpdateIng.setMessage("请稍候..."); checkUpdateIng.setProgressStyle(ProgressDialog.STYLE_SPINNER); return checkUpdateIng; } case 2: { Dialog dialog = new AlertDialog.Builder(CallPlayer.this).setTitle("系统更新").setMessage("发现新版本,请更新!") // 设置内容 .setPositiveButton("确定", // 设置确定按钮 new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int which) { downloadBar = new ProgressDialog(CallPlayer.this); downloadBar.setTitle("正在下载"); downloadBar.setMessage("请稍候..."); downloadBar.setProgressStyle(ProgressDialog.STYLE_SPINNER); downloadUpdateFile(); }
}).setNegativeButton("取消",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { // 点击"取消"按钮之后退出程序 init(); callPlayer(); } }).create();// 创建 return dialog; } default: { return null; } } }
|
转载于:https://www.cnblogs.com/ThunderFox/archive/2012/01/03/2311277.html