// TODO: !! Delete key should also delete this attachment.
public Dialog onCreateDialog(int dialogId){
		Dialog dialog = null;
		try{
			//Log.v(TAG, "onCreateDialog() called");
			if (mManagedDialogs == null) {
				mManagedDialogs = new SparseArray<Dialog>();
			}
			switch(dialogId){
				case DIALOG_DELETE_ATTACHMENT_ID:
					dialog = new AlertDialog.Builder(mActivity)
			        .setTitle(R.string.dialog_confirmDelete)
			        .setIcon(android.R.drawable.ic_dialog_alert)
			        .setMessage(R.string.dialog_areYouSure)
			        .setPositiveButton(R.string.button_yes, new android.content.DialogInterface.OnClickListener(){ // TODO: !!! Make handler implement the DialogInterface.OnClickListener.
			    		public void onClick(DialogInterface dialog, int whichButton){
			    			try{
			    				if( whichButton == android.content.DialogInterface.BUTTON_POSITIVE){
			    					if( !CompletableUtil.delete(mActivity, mAttachmentUri) ){
			    						ErrorUtil.notifyUser(mActivity); // Error already handled, so just notify user.
			    					}
			    					// Notify the ListAdapter that it's cursor needs refreshing
			    					notifyDataSetChanged(); // TODO: !! Isn't this a hack to get around the normal observer thing? NO, not always. Sometimes data changes in the db record that the URI refers to and it isn't really a change to the attachment record.
			    				}
			    			}catch(HandledException h){ // Ignore.
			    			}catch(Exception exp){
			    				Log.e(TAG, "ERR000FD", exp);
			    				ErrorUtil.handleExceptionNotifyUser("ERR000FD", exp, mActivity);
			    			}
			    		}
			    	})
			        .setNegativeButton(R.string.button_no, null)
			    	.create();
		            mManagedDialogs.put(dialogId, dialog);
		            break;
			} 
		}catch(HandledException h){ // Ignore.
		}catch(Exception exp){
			Log.e(TAG, "ERR000FC", exp);
			ErrorUtil.handleExceptionNotifyUser("ERR000FC", exp, mActivity);
		}
		return dialog;
	}
public Dialog onCreateDialog(int dialogId){
Dialog dialog = null;
try{
//Log.v(TAG, "onCreateDialog() called");
if (mManagedDialogs == null) {
mManagedDialogs = new SparseArray<Dialog>();
}
switch(dialogId){
case DIALOG_DELETE_ATTACHMENT_ID:
dialog = new AlertDialog.Builder(mActivity)
.setTitle(R.string.dialog_confirmDelete)
.setIcon(android.R.drawable.ic_dialog_alert)
.setMessage(R.string.dialog_areYouSure)
.setPositiveButton(R.string.button_yes, new android.content.DialogInterface.OnClickListener(){ // TODO: !!! Make handler implement the DialogInterface.OnClickListener.
public void onClick(DialogInterface dialog, int whichButton){
try{
if( whichButton == android.content.DialogInterface.BUTTON_POSITIVE){
if( !CompletableUtil.delete(mActivity, mAttachmentUri) ){
ErrorUtil.notifyUser(mActivity); // Error already handled, so just notify user.
}
// Notify the ListAdapter that it's cursor needs refreshing
notifyDataSetChanged(); // TODO: !! Isn't this a hack to get around the normal observer thing? NO, not always. Sometimes data changes in the db record that the URI refers to and it isn't really a change to the attachment record.
}
}catch(HandledException h){ // Ignore.
}catch(Exception exp){
Log.e(TAG, "ERR000FD", exp);
ErrorUtil.handleExceptionNotifyUser("ERR000FD", exp, mActivity);
}
}
})
.setNegativeButton(R.string.button_no, null)
.create();
mManagedDialogs.put(dialogId, dialog);
break;
}
}catch(HandledException h){ // Ignore.
}catch(Exception exp){
Log.e(TAG, "ERR000FC", exp);
ErrorUtil.handleExceptionNotifyUser("ERR000FC", exp, mActivity);
}
return dialog;
}
public Dialog onCreateDialog(int dialogId){
Dialog dialog = null;
try{
//Log.v(TAG, "onCreateDialog() called");
if (mManagedDialogs == null) {
mManagedDialogs = new SparseArray<Dialog>();
}
switch(dialogId){
case DIALOG_DELETE_ATTACHMENT_ID:
dialog = new AlertDialog.Builder(mActivity)
.setTitle(R.string.dialog_confirmDelete)
.setIcon(android.R.drawable.ic_dialog_alert)
.setMessage(R.string.dialog_areYouSure)
.setPositiveButton(R.string.button_yes, new android.content.DialogInterface.OnClickListener(){ // TODO: !!! Make handler implement the DialogInterface.OnClickListener.
public void onClick(DialogInterface dialog, int whichButton){
try{
if( whichButton == android.content.DialogInterface.BUTTON_POSITIVE){
if( !CompletableUtil.delete(mActivity, mAttachmentUri) ){
ErrorUtil.notifyUser(mActivity); // Error already handled, so just notify user.
}
// Notify the ListAdapter that it's cursor needs refreshing
notifyDataSetChanged(); // TODO: !! Isn't this a hack to get around the normal observer thing? NO, not always. Sometimes data changes in the db record that the URI refers to and it isn't really a change to the attachment record.
}
}catch(HandledException h){ // Ignore.
}catch(Exception exp){
Log.e(TAG, "ERR000FD", exp);
ErrorUtil.handleExceptionNotifyUser("ERR000FD", exp, mActivity);
}
}
})
.setNegativeButton(R.string.button_no, null)
.create();
mManagedDialogs.put(dialogId, dialog);
break;
}
}catch(HandledException h){ // Ignore.
}catch(Exception exp){
Log.e(TAG, "ERR000FC", exp);
ErrorUtil.handleExceptionNotifyUser("ERR000FC", exp, mActivity);
}
return dialog;
}
public Dialog onCreateDialog(int dialogId){
Dialog dialog = null;
try{
//Log.v(TAG, "onCreateDialog() called");
if (mManagedDialogs == null) {
mManagedDialogs = new SparseArray<Dialog>();
}
switch(dialogId){
case DIALOG_DELETE_ATTACHMENT_ID:
dialog = new AlertDialog.Builder(mActivity)
.setTitle(R.string.dialog_confirmDelete)
.setIcon(android.R.drawable.ic_dialog_alert)
.setMessage(R.string.dialog_areYouSure)
.setPositiveButton(R.string.button_yes, new android.content.DialogInterface.OnClickListener(){ // TODO: !!! Make handler implement the DialogInterface.OnClickListener.
public void onClick(DialogInterface dialog, int whichButton){
try{
if( whichButton == android.content.DialogInterface.BUTTON_POSITIVE){
if( !CompletableUtil.delete(mActivity, mAttachmentUri) ){
ErrorUtil.notifyUser(mActivity); // Error already handled, so just notify user.
}
// Notify the ListAdapter that it's cursor needs refreshing
notifyDataSetChanged(); // TODO: !! Isn't this a hack to get around the normal observer thing? NO, not always. Sometimes data changes in the db record that the URI refers to and it isn't really a change to the attachment record.
}
}catch(HandledException h){ // Ignore.
}catch(Exception exp){
Log.e(TAG, "ERR000FD", exp);
ErrorUtil.handleExceptionNotifyUser("ERR000FD", exp, mActivity);
}
}
})
.setNegativeButton(R.string.button_no, null)
.create();
mManagedDialogs.put(dialogId, dialog);
break;
}
}catch(HandledException h){ // Ignore.
}catch(Exception exp){
Log.e(TAG, "ERR000FC", exp);
ErrorUtil.handleExceptionNotifyUser("ERR000FC", exp, mActivity);
}
return dialog;
}