2016-06-10 58 views
0

我有一個RecyclerView.Adapter類,我想將其轉換爲ListAdapter 但它返回一個錯誤:「無法投射」。Casting ListAdapter到RecyclerView.Adapter失敗

public void setAdapter() 
{ 
    RecyclerAdapter adapter = new RecyclerAdapter(context); 
    ListView.setAdapter((ListAdapter) adapter); 
} 

回答