ribot / easy-adapter

[DEPRECATED] Easy Adapters library for Android
http://ribot.github.io
Apache License 2.0
421 stars 50 forks source link

EasyAdapter cannot be cast to android.widget.ArrayAdapter #26

Closed devloe closed 9 years ago

devloe commented 9 years ago

I'm using SuperListView. I've implemented setupSwipeToDismiss, but when I dismiss a list item, I get the following error:

java.lang.ClassCastException: uk.co.ribot.easyadapter.EasyAdapter cannot be cast to android.widget.ArrayAdapter

Any toughts?

devloe commented 9 years ago

I've solved it. Has to implement my own onDismiss, like so

  public void onDismiss(ListView listView, int[] reverseSortedPositions) {
                for (int position : reverseSortedPositions) {
                    items.remove(list.getAdapter().getItem(position));
                }
                ((EasyAdapter) list.getAdapter()).notifyDataSetChanged();
            }`