Opa Matheus, que bom que deu certo. :)
2014-11-09 18:35 GMT-02:00 Matheus Henrique da Silva <matheustargaryen@gmail.com>:
Rodrigo, sua resposta foi de extrema ajuda. Atualmente eu estou usando esse pattern de listener como vc indicou e está tudo funcionando muito bem, até então nenhuma resposta havia me funcionado tão bem. Eu adiciono e removo o listener no onResume() e onPause() do fragment, o que me facilita muito. Após adicionar uma mensagem (via UI thread), é só verificar se existe um listener na conversa (o que indica que ela está sendo exibida) e chamar o metodo de atualização nela.public void addMessage(Mensagem mensagem, int limit)throws CalledFromWrongThreadException {if (Looper.getMainLooper().getThread() == Thread.currentThread()) {log.add(mensagem);verificaLimite(limit);if (mListener != null) {mListener.notifyListview();}} else {throw new CalledFromWrongThreadException("Este método precisa ser chamado via UI Main Thread.");}}Muito obrigado cara. Sem palavras.--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.






0 comentários:
Postar um comentário