@Override protected ResponseObject doInBackground(String[] params) { ResponseObject<ArrayList<SubItem>> result = QuestionAPI.getAllMyTags(); if (TextUtils.isEmpty(UserAPI.getUserID())) { result.error_message = "无法获得用户id"; result.error = ResponseError.NO_USER_ID; } else if (result.ok) { ArrayList<SubItem> subItems = result.result; ArrayList<AskTag> myTags = new ArrayList<>(); for (int i = 0; i < subItems.size(); i++) { SubItem item = subItems.get(i); AskTag myTag = new AskTag(); myTag.setName(item.getName()); myTag.setValue(item.getValue()); myTag.setType(item.getType()); myTag.setSection(item.getSection()); myTag.setSelected(i < defaultTagsNumber); myTag.setOrder(i); myTags.add(myTag); } mergeMyGroups(myTags); AskTagHelper.putAllMyTags(myTags); getButtons(); } return result; }
@Override protected ResultObject doInBackground(String... params) { String questionID = params[0]; String title = params[1]; String summary = params[2]; String comment = params[3]; return QuestionAPI.recommendQuestion(questionID, title, summary, comment); }
@Override protected ResultObject<ArrayList<AceModel>> doInBackground(Integer... params) { if (!TextUtils.isEmpty(notice_id)) { UserAPI.ignoreOneNotice(notice_id); notice_id = null; } offset = params[0]; if (offset < 0) { ResultObject<Question> questionResult = QuestionAPI.getQuestionDetailByID(question.getId()); if (questionResult.ok) { publishProgress(questionResult); return QuestionAPI.getQuestionAnswers(question.getId(), 0); } else { return new ResultObject<>(); } } else { return QuestionAPI.getQuestionAnswers(question.getId(), offset); } }
@Override protected ResultObject doInBackground(String... params) { String questionID = params[0]; return QuestionAPI.unfollowQuestion(questionID); }