Reputation: 58
I am using a default array adapter to display my listview
.
How do I highlight specific rows from my listview
without touching anything i.e. without using onTouch()
or onItemClick()
(Just by using a code!) ?
Upvotes: 0
Views: 91
Reputation: 5061
I guess the way you should do it is use custom adapter and in getVew function highlight the row you needed
e.g.
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
View row = convertView;
final Holder holder;
if (row == null) {
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
row = inflater.inflate(layoutResourceId, parent, false);
...
if(position==thePositionYouNeed)
row.setBackgroundColor(color)
Upvotes: 1