I'm using RxBinding and creating a subscription in RecyclerView adapter in onBindViewHolder method, which reuses items. Is there any simple way to check if I already assigned subscriber to an EditText object and if so delete that subscription?
My code looks like this
public void onBindViewHolder(final ItemViewHolder holder, int position) {
holder.text.setText(mProvider.get(position).text);
Subscription textSub = RxTextView.textChanges(holder.text).subscribe(new Action1<CharSequence>() {
@Override
public void call(CharSequence charSequence) {
...
}
});
subscriptions.add(textSub);
}