0

As question, how to display all the checkInName of the event? From the code below, I'm already able to get the event name from

String attendance = intent.getStringExtra("Attendance"); 

But how to display it inside the recycle view?

package com.example.edward.neweventmanagementsystem;

import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.edward.neweventmanagementsystem.Model.AttendanceInfo;
import com.example.edward.neweventmanagementsystem.ViewHolder.MenuViewHolder;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.firebase.ui.database.FirebaseRecyclerOptions;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;

public class attendanceListMainList extends AppCompatActivity {

    RecyclerView recycle_menu;
    RecyclerView.LayoutManager layoutManager;
    private DatabaseReference mDatabaseReference;
    FirebaseRecyclerAdapter<AttendanceInfo, MenuViewHolder> adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_attendance_list_main_list);

        mDatabaseReference = FirebaseDatabase.getInstance().getReference().child("AttendanceRecord");

        searchAttendance();

    }

    public void searchAttendance() {

        Intent intent = getIntent();
        String attendance=  intent.getStringExtra("Attendance");
        System.out.println("Test in StaffAttendanceRecordTable: "+attendance);

    }
    @Override
    public void onBackPressed() {
        Intent intent = new Intent(this, StaffAttendanceRecordTable.class);
        startActivity(intent);
    }

}

Sample

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
MAN CHUN LIEW
  • 49
  • 1
  • 9
  • 1
    add to `arraylist` and show it, what is problem ? – Ali Ahmed Nov 12 '18 at 09:20
  • **[This](https://stackoverflow.com/questions/49383687/how-can-i-retrieve-data-from-firebase-to-my-adapter/49384849)** is a recommended way in which you can retrieve data from a Firebase Realtime database and display it in a `RecyclerView` using `FirebaseRecyclerAdapter`. – Alex Mamo Nov 12 '18 at 18:54

0 Answers0