@Override protected void onCancelled(Boolean aBoolean) { super.onCancelled(aBoolean); // mPostUploadNotifier and mPost can be null if onCancelled is called before doInBackground if (mPostUploadNotifier != null && mPost != null) { mPostUploadNotifier.updateNotificationError( mErrorMessage, mIsMediaError, mPost.isPage(), mErrorUnavailableVideoPress); } }
@Override protected void onPostExecute(Boolean postUploadedSuccessfully) { if (postUploadedSuccessfully) { WordPress.wpDB.deleteMediaFilesForPost(mPost); mPostUploadNotifier.cancelNotification(); mPostUploadNotifier.updateNotificationSuccess(mPost, mLatestIcon); } else { mPostUploadNotifier.updateNotificationError( mErrorMessage, mIsMediaError, mPost.isPage(), mErrorUnavailableVideoPress); } postUploaded(); EventBus.getDefault() .post(new PostUploadEnded(postUploadedSuccessfully, mPost.getLocalTableBlogId())); }