title: animatedVectorDrawable is not animating in for loop
body: <p>I have been trying to implement animation vectors . I managed to do it correctly but there's seem to be a problem.
  I used recycler view to display all contacts.
  I have used selected and unselected functions to play animations on contact profile pic. I did it and selecting and unselecting animations have been working correctly but when I tried to unselect all selected contacts through this loop it seems to be not working and it only happens when I want to unselect them all .</p>
  <pre><code>    private void deselectAll(viewHolder holder) {
          for(int i = 0; i &lt; selected_contacts.size(); i++){
              unselected(holder, contacts.indexOf(selected_contacts.get(i)),true);
          }
          selected_contacts.clear();
      }
  </code></pre>
  <p>i have used unselected function which's code is down below. can anybody help me with this problem here cause i cant seem to figure it out.</p>
  <pre><code>private void unselected(viewHolder holder, int position, boolean b) {
          if(!b){
          selected_contacts.remove(contacts.get(position));
          }
          contacts.get(position).setSelected(false);
  
          AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) AppCompatResources.getDrawable(context, R.drawable.item_unselected);
          holder.image2.setBackground(animatedVectorDrawable);
          animatedVectorDrawable.start();
  
          Contact.selectedItems--;
          Log.i(&quot;items&quot;, &quot;numbers of selected items are updated to &quot; + Contact.selectedItems);
  
          String top_text = Contact.selectedItems + &quot; Contacts selected&quot;;
          selectedItems.setText(top_text);
  
          Log.i(&quot;animation&quot;, &quot;animation of item no &quot; + position + &quot; is unselected&quot;);
      }
  </code></pre>
  <hr />
  <p>And also animation is not working even for single item selected when tried to use setImageDrawable instead of setBackground idk what's the difference.</p>
  <hr />
  <p>If you wanna see my whole project here is link to My project :
  <a href="https://github.com/kevaldonga/contacts" rel="nofollow noreferrer">https://github.com/kevaldonga/contacts</a></p>