Here I have used addChildEventListener() method fetch the information from Firebase database under the method onChildAdded().
Please ignore hold.add(chat);
as I was just getting the new child's items in an ArrayList.
chat is an object of class helper which consists of the name and message of a person.
But the problem that I am facing is that when I am appending the text I am recieving the data using (chat.name+"\n"+chat.message+"\n\n)
in a TextView it gets repeated.
i.e I want it to be like
Arunav hi
Arunav wssup bud
Instead of :
Arunav hi
Arunav wssup bud
Arunav hi
Arunav wssup bud
The messages get repeated each time I press the send button of my app.
Thanks in Advance for helping,please forgive me if my question sounds dumb(its my first question on StackOverFlow and also I have very basic knowledge about Firebase Databases. I strongly look forward for help.
AGAIN THANKS.