@Override protected void onCancelled(Void aVoid) { super.onCancelled(aVoid); if (statusDraftBean != null) { DraftDBManager.getInstance().remove(statusDraftBean.getId()); DraftDBManager.getInstance().insertStatus(content, geoBean, picPath, accountId); } else { DraftDBManager.getInstance().insertStatus(content, geoBean, picPath, accountId); } Toast.makeText( SendWeiboService.this, getString(R.string.send_failed_and_save_to_draft), Toast.LENGTH_SHORT) .show(); stopServiceIfTasksAreEnd(WeiboSendTask.this); }
@Override protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); if (statusDraftBean != null) DraftDBManager.getInstance().remove(statusDraftBean.getId()); Toast.makeText( SendWeiboService.this, getString(R.string.send_successfully), Toast.LENGTH_SHORT) .show(); stopServiceIfTasksAreEnd(WeiboSendTask.this); }