Skip to content

Commit

Permalink
[b] Fix onSuccessCallback.onSuccess() not being called when `.withP…
Browse files Browse the repository at this point in the history
…rocessVisibility(false)`

yesidlazaro#28
  • Loading branch information
luongvo committed Mar 10, 2017
1 parent 87205de commit b7bf9d9
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,22 +298,23 @@ protected Boolean doInBackground(String... arg0) {
@Override
protected void onPostExecute(Boolean result) {
super.onPostExecute(result);
if (processVisibility) {
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
if (result) {
if (!TextUtils.isEmpty(sendingMessageSuccess)) {
Toast.makeText(mContext, sendingMessageSuccess, Toast.LENGTH_SHORT).show();
}
if (onSuccessCallback != null) {
onSuccessCallback.onSuccess();
}
}else {
if (!TextUtils.isEmpty(sendingMessageError)) {
Toast.makeText(mContext, sendingMessageError, Toast.LENGTH_SHORT).show();
}
if (onFailCallback != null) {
onFailCallback.onFail();
}
}

if (result) {
if (processVisibility && !TextUtils.isEmpty(sendingMessageSuccess)) {
Toast.makeText(mContext, sendingMessageSuccess, Toast.LENGTH_SHORT).show();
}
if (onSuccessCallback != null) {
onSuccessCallback.onSuccess();
}
} else {
if (processVisibility && !TextUtils.isEmpty(sendingMessageError)) {
Toast.makeText(mContext, sendingMessageError, Toast.LENGTH_SHORT).show();
}
if (onFailCallback != null) {
onFailCallback.onFail();
}
}
}
Expand Down

0 comments on commit b7bf9d9

Please sign in to comment.