刚刚在我的代码中实现了Recyclerview,取代了Listview.
一切正常.显示对象.
但是logcat说
15:25:53.476 E/RecyclerView:没有连接适配器; 跳过布局
15:25:53.655 E/RecyclerView:没有连接适配器; 跳过布局
代码
ArtistArrayAdapter adapter = new ArtistArrayAdapter(this, artists);
recyclerView = (RecyclerView) findViewById(R.id.cardList);
recyclerView.setHasFixedSize(true);
recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
Run Code Online (Sandbox Code Playgroud)
如您所见,我已经为Recycleview附加了一个适配器.那为什么我一直收到这个错误?
我已经阅读了与同一问题相关的其他问题但没有帮助.