'Firebase data retrieval method returns double the amount of data first time I send a request

This method that I am calling retrieves data from Firebase Realtime Database. First time I call that method to fill a Array List it doubles the amount of objects and then gets to the right amount. Also every time I add a new data to the base and when I refresh the list it does the same thing.

Method where I retrieve data from base



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source