Java Recyclerview无适配器连接跳过布局Android

Java Recyclerview无适配器连接跳过布局Android,java,android,android-recyclerview,Java,Android,Android Recyclerview,这是我的适配器代码。如果需要完整的适配器代码或更多的代码段,请告诉我 public class PostAdapter extends RecyclerView.Adapter<PostAdapter.PostViewHolder>{ private Context context; public PostAdapter(Context context, List<Item> items) { this.context = contex

这是我的适配器代码。如果需要完整的适配器代码或更多的代码段,请告诉我

public class PostAdapter extends RecyclerView.Adapter<PostAdapter.PostViewHolder>{

    private Context context;

    public PostAdapter(Context context, List<Item> items) {
        this.context = context;
        this.items = items;
    }
公共类PostAdapter扩展了RecyclerView.Adapter{
私人语境;
公共PostAdapter(上下文、列表项){
this.context=上下文;
这个项目=项目;
}

您收到该警告是因为您尚未为“回收器”视图设置适配器

PostAdapter adapter = new PostAdapter(getContext(),mItems);
mRecyclerView.setAdapter(adapter);
确保您的回收器视图也有一个布局管理器

mRecylerView.setLayoutManager(new LinearLayoutManager(getContext());

共享您的
RecyclerView
项目布局,并调用
片段/活动
检查这是您的解决方案:-