title: Generating text in a new fragment based on Firebase getRef()
body: <p>I have a listview that generates a list of clubs in Edinburgh including an image, title and special deals. When a user clicks on the club they wish to  see more about a new fragment opens and is populated by data about that club. I was able to get the correct child name using getRef() and output this to a toast, the question is how to I make it that when the user clicks the list my textViews are automatically populated with the corresponding data?</p>
  
  <p>This is my ClubList fragment</p>
  
  <pre><code>public class ClubListFragment extends Fragment {
  
      private RecyclerView clubList;
  
      private DatabaseReference mDatabase;
  
      public ClubListFragment() {
          // Required empty public constructor
      }
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          View rootView = inflater.inflate(R.layout.fragment_club_list, container, false);
  
  
          mDatabase = FirebaseDatabase.getInstance().getReference().child("clubs");
  
          mDatabase.keepSynced(true);
  
  
          //declare and populate the clublist view
          clubList = (RecyclerView) rootView.findViewById(R.id.lstClub_List);
          clubList.setHasFixedSize(true);
          clubList.setLayoutManager(new LinearLayoutManager(getActivity()));
  
          return rootView;
      }
  
      @Override
      public void onStart() {
          super.onStart();
  
          FirebaseRecyclerAdapter&lt;Clubs, ClubListHolder&gt; firebaseRecyclerAdapter = new FirebaseRecyclerAdapter&lt;Clubs, ClubListHolder&gt;(
  
              Clubs.class,
              R.layout.club_row,
              ClubListHolder.class,
              mDatabase
  
  
          ) 
          {
              @Override
              protected void populateViewHolder(ClubListHolder viewHolder, Clubs model, int position) {
  
                  final String post_key = getRef(position).getKey();
  
                  viewHolder.setTitle(model.getTitle());
                  viewHolder.setOpen(model.getOpen());
                  viewHolder.setDesc1("*" + model.getDesc1());
                  viewHolder.setDesc2("*" + model.getDesc2());
                  viewHolder.setDesc3("*" + model.getDesc3());
                  viewHolder.setImage(getActivity(), model.getImage());
  
                  viewHolder.nView.setOnClickListener(new View.OnClickListener() {
                      @Override
                      public void onClick(View v) {
  
                          Toast.makeText(getActivity(), post_key , Toast.LENGTH_SHORT).show();
  
                          ClubInfoFragment fragment = new ClubInfoFragment();
                          android.support.v4.app.FragmentTransaction fragmentTransaction =
                                  getActivity().getSupportFragmentManager().beginTransaction();
                          fragmentTransaction.replace(R.id.fragment_container, fragment);
                          fragmentTransaction.commit();
                      }
                  });
              }
          };
          clubList.setAdapter(firebaseRecyclerAdapter);
      }
  
      public static class ClubListHolder extends RecyclerView.ViewHolder{
  
          View nView;
  
          public ClubListHolder(View itemView) {
              super(itemView);
  
              nView = itemView;
          }
  
          public void setTitle(String title) {
  
              TextView club_title = (TextView) nView.findViewById(R.id.txtTitle);
              club_title.setText(title);
  
          }
  
          public void setOpen(String open) {
  
              //finds day of the week and converts it to a string
              String day;
              SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE", Locale.UK);
  
              Calendar calendar = Calendar.getInstance();
              day = dayFormat.format(calendar.getTime());
  
              //find the Open/Closed Today TextView
              TextView club_open = (TextView) nView.findViewById(R.id.txtOpen);
  
              //parses the database for a day that macthes the current day, if found then...
              if (open.contains(day)){
                  club_open.setText("Open Today");
                  ((TextView) nView.findViewById(R.id.txtOpen)).setTextColor(Color.GREEN);
              }
  
              //else do this
              else
              {
                  club_open.setText("Closed Today");
                  ((TextView) nView.findViewById(R.id.txtOpen)).setTextColor(Color.RED);
              }
          }
  
          public void setDesc1(String desc1) {
  
              TextView club_desc1 = (TextView) nView.findViewById(R.id.txtDesc1);
              club_desc1.setText(desc1);
  
          }
  
          public void setDesc2(String desc2) {
  
              TextView club_desc2 = (TextView) nView.findViewById(R.id.txtDesc2);
              club_desc2.setText(desc2);
  
          }
  
          public void setDesc3(String desc3) {
  
              TextView club_desc3 = (TextView) nView.findViewById(R.id.txtDesc3);
              club_desc3.setText(desc3);
  
          }
  
          public void setImage(Context ctx, String image) {
  
              ImageView club_image = (ImageView) nView.findViewById(R.id.imgClub);
              Picasso.with(ctx).load(image).into(club_image);
          }
      }
  
  }
  </code></pre>
  
  <p>Should I somehow save the Firebase Reference and make it a global variable to then be used in a new fragment or is there a way to do it from my ClubListFragment?</p>
  
  <p>Any help is appreciated  </p>