public View getView(final int position, View v, ViewGroup parent) {
Teami = (LayoutInflater) contextTeam
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = Teami.inflate(com.yellowflag.activity.R.layout.yf_login3_list_row,
null);
TextView txtzmarket = (TextView) v
.findViewById(com.yellowflag.activity.R.id.txtzmarket);
TextView txtzname = (TextView) v
.findViewById(com.yellowflag.activity.R.id.txtzname);
final ImageView img_nfl_favoriteactive = (ImageView) v
.findViewById(com.yellowflag.activity.R.id.imgfavoriteactive);
ImageView nfllist_image = (ImageView) v
.findViewById(com.yellowflag.activity.R.id.list_image);
String s = TeamList.get(position).getTeamID();
String lower = s.toLowerCase();
int image_id = contextTeam.getResources().getIdentifier(lower + "_25",
"drawable", contextTeam.getPackageName());
nfllist_image.setBackgroundResource(image_id);
txtzmarket.setText(TeamList.get(position).getMarket());
txtzname.setText(TeamList.get(position).getName());
if (selected[position] == 1) {
img_nfl_favoriteactive.setSelected(true);
}
img_nfl_favoriteactive.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
for (int i = 0; i < TeamList.size(); i++) {
selected[i] = 0;
}
img_nfl_favoriteactive.setSelected(true);
selected[position] = 1;
}
});
return v;
}
私のrowviewの画像ビューであるimg_nfl_favoriteactiveを使用してリストビューを更新したい、getviewメソッドでClickevent。Androidを使用してgetviewメソッドclickeventを使用してこれを更新する方法を教えてください。繰り返しますが、このリスト ビューで単一項目セレクターを実装する方法も知りたいです。