public void doGetAction() { if (!StringUtils.isEmpty(actionId) && (currentAction == null || !currentAction.getId().equals(actionId))) { int id = Integer.parseInt(actionId); // TODO: this should be able to process generic actions. CommentUtils.getComment( getActivity(), new CommentGetListener() { @Override public void onError(SocializeException error) { countdown(); showError(getContext(), error); } @Override public void onGet(Comment entity) { ActionDetailLayoutView.this.currentAction = entity; content.setAction(entity); if (entity.getUser() != null) { doGetUserProfile(entity.getUser().getId(), entity); } else if (!StringUtils.isEmpty(userId)) { doGetUserProfile(Long.parseLong(userId), entity); } } }, id); } else if (!StringUtils.isEmpty(userId)) { doGetUserProfile(Long.parseLong(userId), null); } }
@Override protected void onListItemClick(ListView l, View v, int position, long id) { if (position <= 1) { String entity = null; switch (position) { case 0: entity = "http://getsocialize.com"; break; } CommentUtils.showCommentView( this, Entity.newInstance(entity, "Socialize"), new OnCommentViewActionListener() { @Override public void onError(SocializeException error) { error.printStackTrace(); } @Override public void onRender(CommentListView view) {} @Override public void onReload(CommentListView view) {} @Override public void onPostComment(Comment comment) {} @Override public void onCreate(CommentListView view) {} @Override public void onCommentList( CommentListView view, List<Comment> comments, int start, int end) {} @Override public void onBeforeSetComment(Comment comment, CommentListItem item) {} @Override public void onAfterSetComment(Comment comment, CommentListItem item) {} }); } else { Class<?> activityClass = activities[position - 1]; if (activityClass != null) { Intent intent = new Intent(this, activityClass); startActivity(intent); } } }
/* (non-Javadoc) * @see com.socialize.demo.DemoActivity#executeDemo() */ @Override public void executeDemo(String text) { CommentUtils.getCommentsByEntity( this, entity.getKey(), 0, 50, new CommentListListener() { @Override public void onList(ListResult<Comment> comments) { handleSocializeResult(comments); } @Override public void onError(SocializeException error) { handleError(GetCommentsByEntityActivity.this, error); } }); }