ListView Activity in Android
<p>How to differentiate between two items in the ListView Activity(Android)?? As i am creating my own contact list and want to differentiate items as online and offline users. That means i want to change the text color of different items. </p>

<p>this is my sample code, where i am inserting the contact one by one, what exactly i need to change here -
@Override</p>

<pre><code>public View getView(int position, View convertView, ViewGroup parent) {


    // ViewHolder will buffer the assess to the individual fields of the row layout.
    ViewHolder holder;

    // Recycle existing view if passed as parameter, This will save memory and time on Android
    // This only works if the base layout for all classes are the same.
    View rowView = convertView;

    if (rowView == null) {

        LayoutInflater inflater = context.getLayoutInflater();
        rowView = inflater.inflate(R.layout.rowlayout, null, true);
        holder = new ViewHolder();
        holder.textView = (TextView) rowView.findViewById(R.id.label);
        holder.imageView = (ImageView) rowView.findViewById(R.id.icon);
        rowView.setTag(holder);
    } else {
        holder = (ViewHolder) rowView.getTag();
    }

    holder.textView.setText(items[position]);

    return rowView;
</code></pre>
