In Adapter Class
public View getView(final int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = getLayoutInflater();
View row = inflater.inflate(R.layout.vehicals_details_row, parent, false);
Button deleteImageView = (Button) row.findViewById(R.id.DeleteImageView);
deleteImageView.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
//...
}
});
}
But you can get an issue - listView row not clickable. Solution:
- make ListView focusable
android:focusable="true"
- Button not focusable
android:focusable="false"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…