Example #1
0
  protected void postFeedResponse(FeedItemResponse response, FeedItem feedItem) {

    if (mActivityView != null) {
      if (NetworkUtils.handleResponseComm(response)) {
        postFeedFailed(feedItem);
        return;
      } else if (response.errCode == ErrorCode.ERR_CODE_USER_FORBIDDEN) {
        ToastMsg.showShortMsgByResName("umeng_comm_discuss_post_feed_failed_forbid");
        postFeedFailed(feedItem);
        return;
      }
    }

    if (response.errCode == ErrorCode.NO_ERROR) {
      ToastMsg.showShortMsgByResName("umeng_comm_send_success");
      if (mIsShowNotification) {
        PostNotifycation.clearPostNotifycation(mContext);
      } else {
        mActivityView.postFeedComplete(true);
      }
      FeedMemento.clear(mContext);
      // 发送广播
      BroadcastUtils.sendFeedPostBroadcast(mContext, feedItem);
    }
  }
Example #2
0
 private void postFeedFailed(FeedItem feedItem) {
   if (mIsShowNotification) {
     PostNotifycation.showPostNotifycation(
         mContext, ResFinder.getString("umeng_comm_send_failed"), feedItem.text);
   } else {
     mActivityView.postFeedComplete(false);
   }
 }
Example #3
0
 /**
  * 存储feed,以便发送失败时进行重发
  *
  * @param feedItem
  */
 private void saveFeedItem(FeedItem feedItem) {
   // 保存这次要提交的数据,用于发送失败时的重新发送
   FeedMemento.createMemento(mContext, feedItem);
   // 清除状态
   mActivityView.clearState();
   final String title = ResFinder.getString("umeng_comm_send_ing");
   PostNotifycation.showPostNotifycation(mContext, title, feedItem.text);
 }