小编afc*_*007的帖子

回收视图只显示1个元素

我正在使用Firebase在我的应用程序上实现一些逻辑.

我需要使用循环视图和自定义适配器为我的用户设置一些信息,每次我做一个prepareData(),只显示1个元素而不是我的所有数组,我认为它可能与某些事情有关我的布局,因为在适配器上我收到了所有信息.

所以在我的主要活动中我有这个:

package com.esmad.pdm.friendlymanager;

import android.content.Intent;
import android.icu.text.MessagePattern;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.esmad.pdm.friendlymanager.model.Event;
import com.esmad.pdm.friendlymanager.model.EventViewModel;
import com.esmad.pdm.friendlymanager.model.Participant;
import com.esmad.pdm.friendlymanager.other.EventGameAdapter;
import com.esmad.pdm.friendlymanager.other.Participants;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;

import java.util.ArrayList;

public class MatchInvitation extends AppCompatActivity {

    FirebaseDatabase database;
    DatabaseReference myRef;
    DatabaseReference user;
    private FirebaseAuth auth;
    String id;
    String username;
    RecyclerView ps;
    Participants participantAdapter;
    TextView title1;
    ArrayList<Participant> participants;
    boolean exists;
    String matchId;


    @Override
    protected …
Run Code Online (Sandbox Code Playgroud)

xml android firebase android-recyclerview

1
推荐指数
1
解决办法
87
查看次数

标签 统计

android ×1

android-recyclerview ×1

firebase ×1

xml ×1