Back to project page AndroidFileBroadcast.
The source code is released under:
Apache License
If you think the Android project AndroidFileBroadcast listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.bucketdevelopers.uft; // w ww .j a va 2s. c o m import java.util.ArrayList; import java.util.List; import android.content.Context; import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; public class CustomAdaptor extends ArrayAdapter<String> { private final Context context; private final List<String> values; private final ArrayList<Integer> selectedItems; public CustomAdaptor(Context context, List<String> objects, ArrayList<Integer> selected) { super(context, R.layout.list_text, objects); this.context = context; this.values = objects ; this.selectedItems = selected; // TODO Auto-generated constructor stub } @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowView = inflater.inflate(R.layout.list_text, parent, false); TextView textView = (TextView) rowView.findViewById(R.id.tv_list); textView.setText(values.get(position)); if(selectedItems.contains((Integer)position)) { textView.setTextColor(Color.BLUE); } return rowView; } }