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); }
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); }