I have a RecyclerView with data from an API. After pressing a item from RecyclerView opens a new fragment with another API call where i fetch new data based of ID from item pressed.
When i press first element everything is fine - OBSERVER send me the object from API call, and trigger once - Ok. The problem is when i press for a random second element from Recycler because OBSERVER first will trigger with the object from previous call after will trigger with the right object.
One of the solution is to place an IF and to listen only second trigger but in this case will not work the case when i press for the first time because it will trigger only once and i will wait for second one.
Do you know how to do that observer will trigger only once or will trigger every time twice ?