I am using a recyclerView and I have two classes one which contains the recyclerView and were I set the adapter and one class for the adapter.
In the first class if I set this :
final Subscription subscription = new BaseQuery.Builder("Posts")
.where("objectId", ratingSimplePost.getPostId())
.build()
.subscribe();
// Listen
subscription.on(Subscription.UPDATE, new OnListener() {
@Override
public void on(final JSONObject object) {
Log.d(MainActivity.class.getSimpleName(),"Updated");
}
});
What's inside the on method gets executed one time but if I put it inside the adapter class in the onBindViewHolder method the on method gets executed multiple times? Any idea why this is happening and is there a way to fix it ?
I am using a recyclerView and I have two classes one which contains the recyclerView and were I set the adapter and one class for the adapter.
In the first class if I set this :
What's inside the on method gets executed one time but if I put it inside the adapter class in the onBindViewHolder method the on method gets executed multiple times? Any idea why this is happening and is there a way to fix it ?