public void showUpdateDialog() { AlertDialog.Builder builder = new Builder(this); builder.setTitle("升级提醒:"); builder.setMessage(updateInfo.getDescription()); builder.setPositiveButton("升级", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { Log.i(TAG, updateInfo.getApkurl()); downLoadApk(); } }); builder.setNegativeButton("下次", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { loadMainUi(); } }); builder.show(); }
原文地址:http://blog.csdn.net/feecooling/article/details/38427955