title: How can adapter send other parameters from array with objects to listview?
body: <p>I must admit that theory of adapters is not completely clear to me. In my app, I created ListView with parking places numbers and want to change a color of text based on their availability. ListView items get numbers from the array with "Dock" Objects, where every DockPlace has ID (number) and isAvailabile Status. My adapter can take numbers from Dock Object and put it in ListView. It also can change text colour, but I don't have any idea how can I get other parameters about objects.</p>
  
  <p>Adapter:</p>
  
  <pre><code>ListView docksList = (ListView) findViewById(R.id.docksList);
      ArrayAdapter&lt;Dock&gt; listAdapter = new ArrayAdapter&lt;Dock&gt;(
              this,
              android.R.layout.simple_list_item_1,
              Dock.docks //Dock - class name. docks - name of array with Dock Objects
      ) {
          @Override
          public View getView(int position, View convertView, ViewGroup parent) {
              View view = super.getView(position, convertView, parent);
              TextView text = (TextView) view.findViewById(android.R.id.text1);
  
              //in this place could be IF statement which check status of dock and can change text color depends on its
  
              text.setTextColor(Color.BLUE);
  
              return view;
          }
      };
  </code></pre>
  
  <p>Dock:</p>
  
  <pre><code>public static final Dock[] docks = {
      new Dock(1, true),
      new Dock(2, true),
      new Dock(3, false),
  };
  private Dock(int number, boolean isAvailable) {
      this.number = number;
      this.isAvailable = isAvailable;
      }
  public int getNumber() {
      return number;
  }
  public boolean getStatus() {
      return isAvailable;
  }
  public String toString() {
      String numberStr = "Dock no "+ String.valueOf(this.number);
      return numberStr;
  }
  </code></pre>