1.This is my listview
<ListView
android:id="@+id/lv_FromTable"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:listSelector="@drawable/list_selector"
android:orientation="vertical" />
2.in onCreate of main activity i load item and set adapter to listview
lv_FromTable = (ListView)rootView.findViewById(R.id.lv_FromTable);
FromTableAdapter = new ManageTableAdapter(context, FromTableList);
lv_FromTable.setAdapter(FromTableAdapter);
FromTableAdapter.notifyDataSetChanged();
3.i want to highlight on first item same click on listview item
4.i have already tried below code
lv_FromTable.performItemClick(lv_FromTable.getAdapter().getView(0, null, null), 0, lv_FromTable.getAdapter().getItemId(0));
it's raise onitemclick event but not highlight on first item.
- How to highlight android listview first item after load items to listview?
ManageTableAdapter
is custom adapter means you can set background within adapter itself. – Involve