1

I have searched the internet for a few days and still cannot solve my problem

I would like to open the photo album and add an overlay with elements an image icon as abutton and a textview so that people press the image then the textview will display a message.

Now, everyting is ok except when scrolling. The message seems appear randomly in other textview. Any ways can keep the message in correct position? I have referenced this ViewHolder - good practice but still fail. My code is:

holder.ordernumber.addTextChangedListener(new TextWatcher()
    {  
        public void onTextChanged(CharSequence s, int start, int before, int count) {      
            mynum_message[position]=s.toString();
        }

        public void beforeTextChanged(CharSequence s, int start, int count,int after) {       
        }

        public void afterTextChanged(Editable s) {                              
        }
    });  

I use an array mynum_message to store the message is a position

and set the text using

holder.mymessage.setText(String.valueOf(mynum_message[position]));

anyone please help! Alex

Community
  • 1
  • 1
user1042911
  • 91
  • 2
  • 6
  • Welcome to StackOverflow. There are many people that are willing to help you. To help us help you, can you please format your code so that it is easier to read? – Code-Apprentice Jun 14 '14 at 06:59
  • I am sorry that I didn't format it properly. So could you point me how to do that?thanks – user1042911 Jun 14 '14 at 10:20
  • How is `position` determined? – Code-Apprentice Jun 14 '14 at 19:36
  • @Code-Apprentice I know what my problem is now. I didn't use holder.imagebtn to listen any change instead I use a traditional way which is (.findViewById) so the position is wrong. Now it works fine. Thanks!! – user1042911 Jun 15 '14 at 02:47

0 Answers0