本文主要是介绍android E/RecyclerView﹕ No adapter attached; skipping layout,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今天获取网络数据并在适配器上适配时,遇到以下问题:
E/RecyclerView﹕ No adapter attached; skipping layout
解决方法:adaper初始化时传递的数据为空,我竟然忘记将获取的网络数据传给list了= =
loge("当前用户录屏数据为:::::" + response); MyRecordVideoBean myRecordVideoBean = JSONObject.parseObject(response, MyRecordVideoBean.class); if (myRecordVideoBean.getCode() == 1000) {list=myRecordVideoBean.getData().getList(); //获取用户录屏并展示 adapter=new MyRecordVideoAdapter(MyRecordVideoActivity.this,list); recyclerView.setAdapter(adapter); //设置按钮弹出popup窗口 adapter.setOnItemPopClickListener(new MyRecordVideoAdapter.OnItemPopClickListener() {@Override public void onItemPopClick(View v, int position) {showPopup();//显示底部弹窗 }}); Log.e("首条信息为=======>", list.get(0).getScreencapUrl());
加上list=myRecordVideoBean.getdata().getList();就可以了
其他解决方法可参考:https://stackoverflow.com/questions/29141729/recyclerview-no-adapter-attached-skipping-layout
这篇关于android E/RecyclerView﹕ No adapter attached; skipping layout的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!