回收站视图显示单个项目
我遇到一个奇怪的错误,其中recyclerview仅显示一个项目。以下是我的recyclerview适配器的代码: public class ChatAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { List<chat> chats; String username; final int My=0,Their=1; public ChatAdapter(List<chat> chats) { this.chats = chats; this.username = PushApp.getApp().getSPF().getStringData(Constants.ANAME); } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { RecyclerView.ViewHolder viewHolder; LayoutInflater inflater = LayoutInflater.from(parent.getContext()); switch (viewType) { case My: View v1 = inflater.inflate(R.layout.my_chat_child, parent, false); …