search

Home  >  Q&A  >  body text

android - Listview imitates TextView likes in Moments without refreshing?

Click a red heart button: xinClick is an Imageview. When the user clicks, the automatic count increases by 1, and the ID of TextView is xin. But the TextView never changes.

                xinClick.setOnClickListener(new OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        // TODO Auto-generated method stub
                        ++count;
                        xin.setText(count+"");//**没有效果**
                    }
                });

This code is written in public View getView(int arg0, View arg1, ViewGroup arg2). How to solve it?

ringa_leeringa_lee2713 days ago1031

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-06-19 09:09:47

    First log to see if the count is increased by one. If not, it may be that the click event was intercepted

    reply
    0
  • Cancelreply