title: Change visibility of a button on a row in a listview
body: <p>I'm using a listview with adapter that extends BaseAdapter.
  Each row in the listview has multiple views, and I want that if the value of a variable is "yes" a picture of the row is visible and if the value is "no" is gone.</p>
  
  <p>But I did not succeed.</p>
  
  <p>I get a forced close when changing visibilities</p>
  
  <p>This is my code, any help is greatly appreciated.</p>
  
  <p>Thanks and regards</p>
  
  <pre><code>public class Adapter_c extends BaseAdapter {
  ...
  public View getView(int position, View convertView, ViewGroup parent) {
          ViewHolder holder = null;
          View vi=convertView;
  
          if(convertView==null)
              vi = inflater.inflate(R.layout.row_concursos, null);
          holder = new ViewHolder();
          holder.title = (TextView)vi.findViewById(R.id.title_c);
          holder.image = (ImageView)vi.findViewById(R.id.image_c);
          holder.button = (Button)vi.findViewById(R.id.button_c);
  
  
  
          HashMap&lt;String, String&gt; items = new HashMap&lt;String, String&gt;();
          items = data.get(position);
  
          try { 
              String imageV = new String(items.get(FIRST_activity.KEY_STATE).getBytes("ISO-8859-1"));
              if (imageV.equals("active")){
  
                  holder.image.setVisibility(View.VISIBLE);
              } else{
  
                  holder.image.setVisibility(View.GONE);
              }
  
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();}
  ...
  </code></pre>