/** * 添加评论 * * @param route 路线 * @param listener 回调 */ public void addComment(final Route route, final OnRouteListener listener) { int commentNum = 0; if (route.getCommentNum() != null) { commentNum = route.getCommentNum(); } commentNum++; route.setCommentNum(commentNum); route.update( mContext, route.getObjectId(), new UpdateListener() { @Override public void onSuccess() { UserManager.getInstance(mContext) .addComment( route, new UserManager.OnUpdateListener() { @Override public void onSuccess() { listener.onSuccess(null); } @Override public void onError() { listener.onError(null); } }); } @Override public void onFailure(int i, String s) { listener.onError(s); } }); }