I am changing listviewAdapter row selected item dynamically. In the adapter by default selectedItem is -1.

```
public static int selectedItem = -1; // no item selected by default

```

and method highlightItem is called in adapter getview method.

```
public View getView(final int position, View convertView, ViewGroup parent) {
        View vi = convertView;
        if (convertView == null) {
            vi = inflater.inflate(R.layout.catalogue_row, null);
            holder = new ViewHolder();

highlightItem(selectedItem,position,vi);

```

and here is my highlightItem method.

```
private static void highlightItem(int selectedItem,int position, View result) {

    System.out.println("selected item "+selectedItem);
    if(position == selectedItem) {

        // you can define your own color of selected item here
        ViewHolder.lyCatalogueRow.setBackgroundColor(Color.parseColor(SharePreferenceController.getListViwHightlightColor()));

    } else {

        // you can define your own default selector here
        ViewHolder.lyCatalogueRow.setBackgroundColor(Color.parseColor(SharePreferenceController.getListViwBackgroundColor()));

    }
}

```

When i click on listview item 

```
private OnItemClickListener itemlistener = new OnItemClickListener(){

@Override
public void onItemClick(AdapterView<?> parent, View view, int position,long id) {
    // TODO Auto-generated method stub

    int item_position = position -1;

    System.out.println("selectedItemposition "+item_position);

    CatalogueEfficientAdapter.selectedItem=item_position;

    catalogueEfficientAdapter.notifyDataSetChanged();

}

```

};

My arraylist contains three items. When I click on third item it is being highlighted. Now if i click on the second element only the second element should be highlighted but third row is being hightlighted. How to select and hightlight selected item only

**Update
the problem is highlightItem which is not updated.**