public static void showMessage(Activity context, int hidehowbutton, String message, DialogInterface.OnClickListener okListener) { AlertDialog.Builder builder= new AlertDialog.Builder(context, R.style.AlertDialogTheme); if(hidehowbutton==CV.SHOW_OK){ builder.setPositiveButton(context.getResources().getString(R.string.common_ok),okListener); }else if(hidehowbutton==CV.SHOW_OK_CANCLE) { builder.setPositiveButton(context.getResources().getString(R.string.common_ok), okListener); builder.setNegativeButton(context.getResources().getString(R.string.common_cancel), null); }else if(hidehowbutton==CV.SHOW_YES_NO) { builder.setPositiveButton(context.getResources().getString(R.string.common_yes), okListener); builder.setNegativeButton(context.getResources().getString(R.string.common_no), null); } builder.setMessage(message); builder.create(); builder.show();}
public static final int SHOW_OK = 1;public static final int SHOW_OK_CANCLE =2;public static final int SHOW_YES_NO = 3;
No comments:
Post a Comment