Code example for AlertDialog.Builder

Methods: setCancelable, setIcon, setNegativeButton, setPositiveButton, setTitle, setView

0
     * Creates a new ProgressDialog 
     *  
     * @param activity 
     * @param progressDialogTitleId 
     *            The resource id for the title. If this is less than or equal to 0, a default title 
     *            is used. 
     * @param progressDialogMsgId 
     *            The resource id for the message. If this is less than or equal to 0, a default 
     *            message is used. 
     * @return The new dialog 
     */ 
    public static ProgressDialog newProgressDialog(final Activity activity,
            int progressDialogTitleId, int progressDialogMsgId) {
        ProgressDialog progressDialog = new ProgressDialog(activity);
        if (progressDialogTitleId <= 0) {
            progressDialogTitleId = R.string.ign_progress_dialog_title;
        } 
        progressDialog.setTitle(progressDialogTitleId);
        if (progressDialogMsgId <= 0) {
            progressDialogMsgId = R.string.ign_progress_dialog_msg;
        }