我有一个RecyclerView.Adapter
类,我想将其转换为ListAdapter
但它返回一个错误:"无法投射"。
public void setAdapter()
{
RecyclerAdapter adapter = new RecyclerAdapter(context);
ListView.setAdapter((ListAdapter) adapter);
}
RecyclerView.Adapter
直接extends Object
因此,您会收到该错误。此外,我认为无论如何您都不能在ListView中使用RecyclerView适配器。