title: Item is not getting selected on spinner when used in recyclerview
body: <p>I have a weird problem when using <code>spinner</code> widget inside a <code>recyclerview</code>. So the story is like this I have a <code>recyclerview</code> which has the spinner and I am passing list which needs to be inflated from fragment to the <code>recyclereview</code> where I am creating <code>adapter</code> if the data is not null and setting it into the spinner, but it works sometimes and most of the times not. It also works when getting focus or typing in edit text below it.</p>
  
  <p><em>Note</em>: I have already checked the other questions related this and yes I am using a white background with black text color layout which is basically a custom layout for the spinner. I am having a hard time figuring out what is going on. </p>
  
  <p>This is my code for setting spinner in <code>onBindViewHolder()</code></p>
  
  <pre><code> @Override
  public void onBindViewHolder(FamilyMemberAdapter.ViewHolder holder, int position) {
      FamilyMemberRecyclerViewModel familyMemberModel = familyMemberRecyclerViewModelList.get(holder.getAdapterPosition());
  
      if (familyMemberModel.getRelationTypeModelList()!=null){
          relationTypeModelArrayAdapter = new ArrayAdapter&lt;RelationTypeModel&gt;(context,R.layout.item_spinner,familyMemberModel.getRelationTypeModelList());
          holder.spnRelationType.setAdapter(relationTypeModelArrayAdapter);
          if (familyMemberModel.getRelationTypeAdapterModel()!=null){
              int positionRelation = relationTypeModelArrayAdapter.getPosition(familyMemberModel.getRelationTypeAdapterModel());
              holder.spnRelationType.setSelection(positionRelation);
          }
      }
  </code></pre>
  
  <p>}</p>
  
  <p>spinner <code>onItemSelectedListener()</code></p>
  
  <pre><code>spnRelationType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
              @Override
              public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
                  //here differentiate between different doc and relation
                  uploadDocumentItemsClickListener.onSpinnerChangeListener(spnRelationType,getAdapterPosition(),adapterView.getSelectedItemPosition());
              }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; adapterView) {
  
              }
          });
  </code></pre>
  
  <p>Here is snapshot of what is going on.</p>
  
  <p>This is I am selecting item from the spinner</p>
  
  <p><a href="https://i.stack.imgur.com/Wsi6E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wsi6E.png" alt="enter image description here"></a></p>
  
  <p>This is after selecting an item from the spinner.</p>
  
  <p><a href="https://i.stack.imgur.com/SJcc7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SJcc7.png" alt="enter image description here"></a></p>
  
  <p>Please let me know if more code needed.</p>