/** Notify a success event */ public void notifySuccess(String message) { if (mActiveAlert != null) { if (mProgressActive) { System.out.println("Final progress message"); mActiveAlert.setTitle("Info"); mActiveAlert.setString(message); mActiveAlert.setIndicator(null); mProgressActive = false; } else { waitForNoAlert(); mActiveAlert = null; } } if (mActiveAlert == null) { mActiveAlert = mController.showInfo(message); mActiveAlert.setCommandListener(this); mAlertDisplayed = true; } }
/** Notify an error event inluding a possible message and exception object */ public void notifyError(String message, Throwable th) { String lErrorMsg = (th != null ? th.toString() : ""); if (mActiveAlert != null) { if (mProgressActive) { mActiveAlert.setTitle("Error"); mActiveAlert.setString(message + "\n" + lErrorMsg); mActiveAlert.setIndicator(null); mProgressActive = false; } else { waitForNoAlert(); mActiveAlert = null; } } if (mActiveAlert == null) { mActiveAlert = mController.showError(message + "\n" + lErrorMsg); mActiveAlert.setCommandListener(this); mAlertDisplayed = true; if (mListener != null) { mListener.notifyError(); } } }