Wrong item position into ListView
<p>I need to open a frameLayout details into a listView, but when I press the buttonDetails, it opens a wrong frameLayout.</p>

<p>here is the code of my adapterView</p>

<p><code>public class SitesAdapter extends ArrayAdapter&lt;AtlantisSite&gt; {</code> </p>

<pre><code>ImageLoader imageLoader;
DisplayImageOptions options;
FrameLayout frameLayout;

public SitesAdapter(Context ctx, int textViewResourceId, List&lt;AtlantisSite&gt; sites) {
    super(ctx, textViewResourceId, sites);

    //Setup the ImageLoader, we'll use this to display our images
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(ctx).build();
    imageLoader = ImageLoader.getInstance();
    imageLoader.init(config);

    //Setup options for ImageLoader so it will handle caching for us.
    options = new DisplayImageOptions.Builder()
            .cacheInMemory(true)
            .cacheOnDisk(true)
            .build();
}

/*
 * (non-Javadoc)
 * @see android.widget.ArrayAdapter#getView(int, android.view.View, android.view.ViewGroup)
 * 
 * This method is responsible for creating row views out of a AtlantisSite object that can be put
 * into our ListView
 */

@Override
public View getView(final int pos, final View convertView, final ViewGroup parent){
    RelativeLayout row = (RelativeLayout)convertView;
    Log.i("AtlantisSites", "getView pos = " + pos);
    //ViewHolder mainViewHolder = null;
    final ViewHolder viewHolder;

    if(null == row){
        //No recycled View, we have to inflate one.
        LayoutInflater inflater = (LayoutInflater)parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        row = (RelativeLayout)inflater.inflate(R.layout.row_site, null);

        viewHolder = new ViewHolder();
        viewHolder.btnDownload = (Button) row.findViewById(R.id.btnDownload);
        viewHolder.btnDownload.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Integer pos=(Integer)v.getTag();
                Log.i("AtlantisSites", "getView pos = " + pos);
                //String url = getItem(pos).getLink();
                DownloadZip zipActivity = new DownloadZip();
                zipActivity.DownloadFromUrlZip();
                //Intent i = new Intent(Intent.ACTION_VIEW);
                //i.setData(Uri.parse(url));
                //Intent zipActivity = new DownloadZip();
                //zipActivity.start...;


                //Toast.makeText(getContext(), "Downloading " + pos, Toast.LENGTH_SHORT).show();
            }
});
viewHolder.btnDetails = (Button) row.findViewById(R.id.btnDetails);
viewHolder.btnDetails.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        //Integer pos = (Integer) v.getTag();
        //Log.i("AtlantisSites", "getView pos = " + pos);
        getItemId(pos);
        if(frameLayout.getVisibility()==View.GONE){
            showFrameLayout();
        } else {
            hideFrameLayout();
        }
    }
});

        row.setTag(viewHolder);
    } else{
        viewHolder = (ViewHolder) row.getTag();
    }




    //Get our View References
    final ImageView iconImg = (ImageView)row.findViewById(R.id.iconImg);
    TextView nameTxt = (TextView)row.findViewById(R.id.nameTxt);
    TextView titleTxt = (TextView)row.findViewById(R.id.titleTxt);
    //Button btnDownload = (Button)row.findViewById(R.id.btnDownload);
    TextView summaryIta = (TextView)row.findViewById(R.id.textViewSummaryItaRow);
    TextView summaryEng = (TextView)row.findViewById(R.id.textViewSummaryEngRow);
    TextView priceItaTxt=(TextView)row.findViewById(R.id.txtViewPriceIta);
    TextView priceEngTxt=(TextView)row.findViewById(R.id.txtViewPriceEng);
    final ProgressBar indicator = (ProgressBar)row.findViewById(R.id.progress);

    frameLayout = (FrameLayout)row.findViewById(R.id.frame_layout_listview);





    //Set the relavent text in our TextViews
    nameTxt.setText(getItem(pos).getName());
    titleTxt.setText(getItem(pos).getTitle());
    summaryIta.setText(getItem(pos).getSummaryIta());
    summaryEng.setText(getItem(pos).getSummaryEng());
    viewHolder.btnDetails.setTag(pos);

    return row;

}

public class ViewHolder{
    Button btnDownload;
    Button btnDetails;
}

private void showFrameLayout(){
    frameLayout = (FrameLayout) frameLayout.findViewById(R.id.frame_layout_listview);
    frameLayout.setVisibility(View.VISIBLE);
}
private void hideFrameLayout(){
    frameLayout = (FrameLayout) frameLayout.findViewById(R.id.frame_layout_listview);
    frameLayout.setVisibility(View.GONE);
}
</code></pre>

<p>}</p>

<p>Something goes wrong with the position.
please help me to find error o solutions.
thanks</p>