title: Changing the background color of a listview row conditionally
body: <p>I'm trying to change the background row color of a list view based on a parameter and on the line <code>View v = super.getView(position, convertView, parent)</code> its giving me the error "Cannot directly invoke the abstract method getView(int, View, ViewGroup) for the type Adapter". Here is the all of the code.</p>
  
  <pre><code>public class CustomListViewAdapter extends BaseAdapter
  {  
  
  LayoutInflater inflater;
  List&lt;ListViewItem&gt; items;
  
  public CustomListViewAdapter(Activity context, List&lt;ListViewItem&gt; items) {  
      super();
  
      this.items = items;
      this.inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  }
  
  @Override  
  public int getCount() {  
      // TODO Auto-generated method stub  
      return items.size();  
  }  
  
  @Override  
  public Object getItem(int position) {  
      // TODO Auto-generated method stub  
      return null;  
  }  
  
  @Override  
  public long getItemId(int position) {  
      // TODO Auto-generated method stub  
      return 0;  
  }
  
  @Override  
  public View getView(final int position, View convertView, ViewGroup parent) {  
      View v = super.getView(position, convertView, parent); 
  
      ListViewItem item = items.get(position);
  
      if(convertView==null)
          v = inflater.inflate(R.layout.my_hospitals, null);
          TextView status = (TextView) v.findViewById(R.id.status);
          TextView name = (TextView) v.findViewById(R.id.name);
          TextView table = (TextView) v.findViewById(R.id.id);
          TextView info = (TextView) v.findViewById(R.id.info);
  
          status.setText(item.status);
          name.setText(item.name);
          table.setText(item.table);
          info.setText(item.info);
  
          if (item.status == "green"){
              v.setBackgroundColor(Color.GREEN);
          }
  
      return v;  
  }
  }
  </code></pre>