public void removeCommentFromList(int pos) { listaComments.remove(itemposition); commentsadapter.notifyDataSetChanged(); if (listaComments.size() == 1) { tvCountComments.setText(Integer.toString(listaComments.size()) + " comentario"); } else { tvCountComments.setText(Integer.toString(listaComments.size()) + " comentarios"); } }
public void addCommentToList(Comment comment) { listaComments.add(0, comment); commentsadapter.notifyDataSetChanged(); if (listaComments.size() == 1) { tvCountComments.setText(Integer.toString(listaComments.size()) + " comentario"); } else { tvCountComments.setText(Integer.toString(listaComments.size()) + " comentarios"); } }