Если вы хотите, чтобы представление списка с настраиваемыми свойствами попыталось реализовать собственный настраиваемый адаптер, который расширяет BaseAdapter
public class CustomListAdapter extends BaseAdapter {
private ArrayList<Generics> allElementDetails;
private LayoutInflater mInflater;
public CustomListAdapter(Context context, ArrayList<Generics> results) {
allElementDetails = results;
mInflater = LayoutInflater.from(context);
}
public int getCount() {
return allElementDetails.size();
}
public Object getItem(int position) {
return allElementDetails.get(position);
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent)
{
convertView = mInflater.inflate(R.layout.filedialog, null);
ImageView imageview = (ImageView) convertView.findViewById(R.id.imageview);
TextView textview = (TextView) convertView.findViewById(R.id.textview);
if(flag==true)
convertview.setClickable(true)
else
convertview.setClickable(false);
return convertView;
}
}
, теперь используйте listview.setOnItemClickListener для применения действий, т.е.будет работать, когда кликабельный вид нажал.
Я думаю, что это может помочь вам ....