Solution : Text is changing while we scrolling the listview

   static class ViewHolder {
        private TextView textView;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        ViewHolder holder = null;

        if (convertView == null) {
            convertView = mLayoutInflater.inflate(R.layout.dialog_list_text,
                    null);
            holder = new ViewHolder();
            holder.textView = (TextView) convertView
                    .findViewById(R.id.list_context_menu_textview);
            convertView.setTag(holder);
            convertView
                    .setTag(R.id.list_context_menu_textview, holder.textView);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.textView.setText(mStringArray.get(position));
        return convertView;
    }

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s