0
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;
}

我想使用 img_nfl_favoriteactive 刷新列表视图,这是我的行视图的图像视图,Clickevent 与 getview 方法。如何使用getview方法刷新这个使用android的clickevent请帮助我?同样,我也想知道如何在此列表视图中实现单项选择器。

4

1 回答 1

1

适配器.notifyDataSetChanged()

用于刷新您的适配器,从而刷新您的列表视图。在您有兴趣的任何地方使用它

于 2012-10-02T06:32:26.037 回答