I have a listView that contains buttons.Every listView Item has either Button1 or Button2. I want it so once Button1 is clicked it becomes invisible and button2 becomes visible. My current code works by making Button1 invisible but when it makes button2 visible it makes the last listView Item button2 visible. Not the button2 within its own listView.

Here is my current XML code

```
 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical">
<View android:id="@+id/topInformationBar"
            android:layout_height="6dip"
            android:layout_width="fill_parent"
            android:background="@drawable/top_infomation_bar"/>
<RelativeLayout
    android:paddingLeft="10dip"
    android:paddingRight="10dip"
    android:paddingBottom="10dip"
    android:paddingTop="4dip"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent">

    <TextView android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="15sp"
        android:textColor="#454545"
        android:textStyle="bold"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        />

    <Button
        android:visibility="invisible"
        android:layout_alignParentRight="true"
        android:id="@+id/button1"
        android:text="button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="15sp"
        android:textStyle="bold"
        android:padding="5dip"
        android:textColor="#FFFFFF"/>
    <Button 
        android:visibility="invisible"
        android:layout_alignParentRight="true"
        android:id="@+id/button2"
        android:text="button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="15sp"
        android:textStyle="bold"
        android:padding="5dip"
        android:textColor="#FFFFFF"/>

</RelativeLayout>
</LinearLayout>

```

Here is my ArrayAdapter that creates the ListView Items

```
class ListAdapter extends ArrayAdapter<Item> {

            public ListAdapter(Context context, int textViewResourceId) {
                super(context, textViewResourceId);
            }

            private List<Item> items;

            public ListAdapter(Context context, int resource, List<Item> items) {
                super(context, resource, items);
                this.items = items;
            }

            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
                View v = convertView;
                if (v == null) {
                    LayoutInflater vi;
                    vi = LayoutInflater.from(getContext());
                    v = vi.inflate(R.layout.list_item, null);

                }

                final Item p = items.get(position);
                if (p != null) {

                    Button1 = (Button)v.findViewById(R.id.Button1);
                    Button2 = (Button)v.findViewById(R.id.Button2);

                            Button1.setOnClickListener(new View.OnClickListener() {
                                public void onClick(View view) {
                                    view.setVisibility(View.INVISIBLE);
                                    Button2.setVisibility(View.VISIBLE);
                                }
                            });

                            Button2.setOnClickListener(new View.OnClickListener() {
                                public void onClick(View view) {
                                    view.setVisibility(View.INVISIBLE);
                                    Button1.setVisibility(View.VISIBLE);
                                }
                            });
                }
                return v;
            }
         }

```

So, if I click Button1 it makes it go Invisible, but it makes Button2 Visible on the last ListView Items. It doesn't make it Visible within its own listView.