baoyongzhang / SwipeMenuListView

[DEPRECATED] A swipe menu for ListView.
MIT License
3.51k stars 1.26k forks source link

cannot be cast to android.widget.BaseAdapter #166

Open SmoothCoffe opened 6 years ago

SmoothCoffe commented 6 years ago

i have cursor that retrieve data from database and display it in ListView get this Error when i try to Display in SwipeMenuListView this is the error java.lang.ClassCastException: com.baoyz.swipemenulistview.SwipeMenuListView$1 cannot be cast to android.widget.BaseAdapter

this is my code

public void populateListView() { Cursor cursor = myDB.searchname(null); String[] fromFieldNames = new String[]{DataBaseAdapter.KEY_ROWID, DataBaseAdapter.KEY_NAME, DataBaseAdapter.KEY_DATE}; int[] toviewIDs = new int[]{R.id.textViewpnumber, R.id.textViewpname, R.id.textViewdate}; mycursoradapter = new SimpleCursorAdapter(this, R.layout.item_layout, cursor, fromFieldNames, toviewIDs, 0); mylist = findViewById(R.id.Listtest); mylist.setAdapter(mycursoradapter); mylist.setFastScrollEnabled(true); mylist.setTextFilterEnabled(true); }