I have a recyclerView that at the moment shows me some data but now I want to change that data for others (title and photo), the question is that I have an array in between and I have no idea how to start, I leave the code and the database:
Of the events of each user you have to take at least the title if you can take tb the photo better than better
In the code I show how I take out the events
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View vista=inflater.inflate( R.layout.fragment_gallery, container, false );
FirebaseDatabase database=FirebaseDatabase.getInstance();
eventos = new ArrayList<>();
recyclerView = vista.findViewById( R.id.rv_gallery );
final Context context = this.getActivity().getApplicationContext();
FirebaseUser userAut;
userAut = FirebaseAuth.getInstance().getCurrentUser();
database.getReference("Users").child(userAut.getUid()).addListenerForSingleValueEvent( new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
User lista=dataSnapshot.getValue(User.class);
eventos=lista.getevents() ;// en debug lo recibe bien
adapter=new AdapterGallery( eventos );
recyclerView.setLayoutManager( new LinearLayoutManager( context ) );
recyclerView.setAdapter( adapter );
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
} );
return vista;
}