Show a button when clicking an ImageView inside a ListView
<p>My problem is that I need to show a button in when I click an <code>ImageView</code> in a <code>ListView</code>.
The button id is eliminarMen in <code>main.xml</code>.</p>

<p>I tried with inflate, inside the ArrayAdapter class, but the button isn`t showing.</p>

<p>This is the code of ArrayAdapter class:</p>

<pre><code>package sms.manager;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class Array extends ArrayAdapter{

private String[] datos;
private ImageView img;
private Button eliminar;


public Array(Context context, int textViewResourceId,String[] items) {
   super(context, textViewResourceId, items);

   this.datos=items;

}

@Override
public View getView(final int position, View convertView, ViewGroup parent) {

  View v=convertView;

    if(v==null){
      LayoutInflater 
    vi=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
      v=vi.inflate(R.layout.cheks, null); 

    }

        LayoutInflater 
    vi=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
        View view=null;
        view=vi.inflate(R.layout.main, null);
        eliminar=(Button)view.findViewById(R.id.eliminarMen);


        TextView contiene=(TextView)v.findViewById(R.id.contieneTexto);
        contiene.setText(datos[position]);

        img=(ImageView)v.findViewById(R.id.icon);
        final ImageView [] imagen=new ImageView[datos.length];
        imagen[position]=img;
        imagen[position].setTag("unchecked");



        imagen[position].setOnClickListener(new OnClickListener(){

        @Override
        public void onClick(View v) {
            eliminar.setVisibility(View.VISIBLE);

            if (imagen[position].getTag()=="unchecked"){
              imagen[position].setImageResource(R.drawable.check);
              imagen[position].setTag("checked");
            }
            else
            {

                             imagen[position].setImageResource(R.drawable.uncheck); 
                imagen[position].setTag("unchecked");
            }
        }

        });

    return v;
}
 }
</code></pre>
