title: Android custom drop down view with dynamic list
body: <p>I have a problem with filling <code>android:entries</code> with <code>String[]</code> from my <code>ViewModel</code>. Code looks like that:</p>
  
  <p><strong>attrs.xml</strong></p>
  
  <pre><code>&lt;declare-styleable name="AutoCompleteDropDown"&gt;
      &lt;attr name="android:entries" /&gt;
  &lt;/declare-styleable&gt;
  </code></pre>
  
  <p><strong>My custom dropdown, AutoCompleteDropDown</strong></p>
  
  <pre><code>public class AutoCompleteDropDown extends AppCompatAutoCompleteTextView {
  
      public AutoCompleteDropDown(Context context, AttributeSet attributes) {
          super(context, attributes);
          TypedArray a = context.getTheme().obtainStyledAttributes(attributes, R.styleable.AutoCompleteDropDown, 0, 0);
          CharSequence[] entries = a.getTextArray(R.styleable.AutoCompleteDropDown_android_entries);
          ArrayAdapter&lt;CharSequence&gt; adapter = new ArrayAdapter&lt;&gt;(context, android.R.layout.simple_dropdown_item_1line, entries);
          setAdapter(adapter);
      }
  ...
  </code></pre>
  
  <p><strong>ViewModel</strong></p>
  
  <pre><code>...
  private String[] genders;
  
  public String[] getGenders() {
      return genders;
  }
  
  public void setGenders(String[] genders) {
      this.genders = genders;
  }
  ...
  </code></pre>
  
  <p><code>genders</code> are filled in <code>ViewModel</code> constructor:</p>
  
  <p><code>genders = dataRepository.getGenders();</code></p>
  
  <p><strong>xml file</strong></p>
  
  <pre><code>&lt;AutoCompleteDropDown
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="@={vm.title}"
      android:entries="@{vm.genders}"
      bind:addTextChangedListener="@{vm.titleValidationChangeListener}"/&gt;
  </code></pre>
  
  <p><code>ViewModel</code> is binded correctly, i'm using it many times in that xml file. When i try to run the app i'm getting:</p>
  
  <blockquote>
    <p>Cannot find the setter for attribute 'android:entries' with parameter
    type java.lang.String[] on AutoCompleteDropDown</p>
  </blockquote>
  
  <p>It works when i use <code>android:entries="@array/genders"</code> but i need this list to be dynamic. Project is in MVVM pattern. Appreciate any help :)</p>