title: How to Set AutocompleteTextview and its adapter inside each recyclerView Item?
body: <p>I want to set up a <code>RecyclerView</code> with each <code>RecyclerView</code> item having an <code>AutocompletetextView</code> and an <code>ImageButton</code> and on click of a button on the main UI, the item should be added and the user can enter relevant data into the <code>AutoCompleteTextView</code> and autocomplete suggestion should show while he is typing in it . </p>
  
  <pre><code>public class SensorListAdapter extends RecyclerView.Adapter&lt;SensorListAdapter.SensorListViewHolder&gt;  {
  
  
  
      List&lt;CrateSensors&gt; crateSensorsList;
      List&lt;String&gt; TagStrings;
  
  
  
      public SensorListAdapter(List&lt;CrateSensors&gt; crateSensorsList) {
          this.crateSensorsList = crateSensorsList;
      }
  
  
  
      public class SensorListViewHolder extends RecyclerView.ViewHolder{
  
  
          AutoCompleteTextView mBarcode ; ImageButton mBarcodeImageButton;
          ArrayAdapter mTagArrayAdapter;
  
          public SensorListViewHolder(View itemView) {
              super(itemView);
  
              mBarcode = itemView.findViewById(R.id.Sensor_List_Enterbarcode_AutoCompleteTextView);
              mBarcodeImageButton = itemView.findViewById(R.id.Sensor_List_Enterbarcode_ImageButton);
  
  
              mTagArrayAdapter = new ArrayAdapter&lt;String&gt;( itemView.getContext(), android.R.layout.simple_dropdown_item_1line,TagStrings);
              mBarcode.setAdapter(mTagArrayAdapter);
              mBarcode.setThreshold(1);
              mBarcode.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      mBarcode.showDropDown();
                  }
              });
  
  
          }
      }
  
  
  
      @NonNull
      @Override
      public SensorListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
  
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.sensor_item ,parent,false);
          return new SensorListViewHolder(view);
  
      }
  
      @Override
      public void onBindViewHolder(@NonNull SensorListViewHolder holder, int position) {
  
          CrateSensors crateSensors = crateSensorsList.get(position);
  
  
  
      }
  
      @Override
      public int getItemCount() {
          return crateSensorsList.size();
      }
  
  
  }
  </code></pre>