/** * Delete 요청 * * @param post Delete할 이야기 */ public void deleteRequest(Post post) { // Alert 창 띄우기. if (!manager.isRunning()) { if (request == null || !(request instanceof PostHttpRequest)) { request = new PostHttpRequest(context); } ((PostHttpRequest) request).actionDelete(post.getId()); manager.request( context, spinnerContainer, request, HttpRequestManager.POST_DELETE_REQUEST, this); } }
/** * 기본 생성자. * * @param position 현재 QuickAction 버튼이 눌린 position */ public PostHeaderQuickActionDialog() { this.quickaction = new QuickActionDialog(context); this.session = Session.getInstance(context); this.manager = HttpRequestManager.getInstance(); this.spinnerContainer = (ViewGroup) getRootView().findViewById(R.id.header_post_wrapper); ActionItem editAction = new ActionItem(); editAction.setIcon(MatjiConstants.drawable(R.drawable.icon_memo_write)); quickaction.addActionItem(editAction); ActionItem deleteAction = new ActionItem(); deleteAction.setIcon(MatjiConstants.drawable(R.drawable.icon_memo_del)); quickaction.addActionItem(deleteAction); // 클릭 리스너 등록. quickaction.setOnActionItemClickListener( new QuickActionDialog.OnActionItemClickListener() { @Override public void onItemClick(int pos) { if (((Identifiable) context).loginRequired()) { if (pos == 0) { Log.d("Matji", "edit button click"); editPost(); } else if (pos == 1) { Log.d("Matji", "delete button click"); deletePost(); } } } }); }
public void reload() { UserHttpRequest request = new UserHttpRequest(this); request.actionShow(session.getCurrentUser().getId()); HttpRequestManager.getInstance() .request(this, request, HttpRequestManager.USER_SHOW_REQUEST, this); }