1

You'd think this would be easy. With this code, I can swipe multiple rows in a listview but what I WANT is to only have one row get swiped at a time. If a user selects a different row, then I want the old row to simply AUTOMATICALLY reseted. Don't know how to do that. Here's my code:

Thanks in advance guys .. Please Help....

getview code ...

public View getView(int position, View convertView, ViewGroup parent) {
    View view = null;
    if(position > allModelItemsArray.size())
        return null;
    Model m = allModelItemsArray.get(position);
    final ViewHolder viewHolder = new ViewHolder();
    ViewHolder Holder = null;
    if (convertView == null) {

        view = inflator.inflate(R.layout.singlerow, null);

        view.setTag(viewHolder);

        viewHolder.text = (TextView) view.findViewById(R.id.label);
        viewHolder.text1 = (TextView) view.findViewById(R.id.label1);
        viewHolder.checkbox = (CheckBox) view.findViewById(R.id.check);
        viewHolder.icon = (ImageView) view.findViewById(R.id.icon);
        viewHolder.checkbox.setTag(m);
        viewHolder.text.setTag(m);
        viewHolder.text1.setTag(m);
        viewHolder.icon.setTag(m);
        viewHolder.position = position;

        Holder = viewHolder;
    } else {
        view = convertView;
        Holder = ((ViewHolder) view.getTag());
    }

    if(this.listener != null)
        view.setOnTouchListener(this.listener);

    Holder.model = m;
    Holder.position = position;
    Holder.text.setText(m.getName());
    Holder.text1.setText(m.getLName());

    return view;
}
HrishikeshB
  • 133
  • 2
  • 10
  • Make use of View flipper to swipe your view left and write also use scrollview insted of list as every time you scroll inside list its getview will call and your views might not come normally – LuminiousAndroid Jul 09 '12 at 12:10
  • Hi Soumyadip Das i have used this code http://stackoverflow.com/questions/4373485/android-swipe-on-list – HrishikeshB Jul 09 '12 at 12:23
  • Thanks Kabir121, But there is any way which solve this issue. – HrishikeshB Jul 09 '12 at 12:26
  • Try to check the [Android Swipe on List][1] possible answers, it might solve you problem [1]: http://stackoverflow.com/a/9340202/475472 – Asaf Pinhassi May 14 '13 at 08:17

0 Answers0