示例#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);
    }
  }
示例#2
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);
 }
示例#3
0
 public void setRepost(boolean isRepost) {
   this.isRepost = isRepost;
   if (isRepost && mActivityView != null) {
     mActivityView.restoreFeedItem(FeedMemento.restoreMemento(mContext));
   }
 }