title: passing data from recycler adapter to activity
body: <p>I am attempting to pass data from my recycler adapter to an activity. Currently i am attempting to use an intent more infomation below</p>
  
  <p><strong>Adapter</strong></p>
  
  <pre><code>public class BlogRecyclerAdapter extends RecyclerView.Adapter&lt;BlogRecyclerAdapter.ViewHolder&gt; {
  
  public List&lt;BlogPost&gt; blog_list;
  
  private FirebaseFirestore firebaseFirestore;
  private FirebaseDatabase firebaseDatabase;
  
  private DatabaseReference mUserDatabase;
  private FirebaseUser mCurrentUser;
  
  private Context mContext;
  
  
  public BlogRecyclerAdapter(Context context, List&lt;BlogPost&gt; blog_list) {
      mContext = context;
      this.blog_list = blog_list;
  }
  
  @NonNull
  @Override
  public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
  
      View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
      firebaseFirestore = FirebaseFirestore.getInstance();
      return new ViewHolder(view);
  }
  
  @Override
  public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
  
      String desc_data = blog_list.get(position).getDesc();
      holder.setDescText(desc_data);
  
  
      String user_name = blog_list.get(position).getUser_id();
      holder.setBlogUserName(user_name);
  
      String image_url = blog_list.get(position).getImage_url();
      holder.setBlogImage(image_url);
  
      final String message_doc = blog_list.get(position).getMessage_doc();
  
  
      /*
      long millisecond = blog_list.get(position).getTimestamp().getTime();
      String dateString = DateFormat.format("MM/dd/yyyy", new Date(millisecond)).toString();
      holder.setTime(dateString);
      */
  
  
      //  String user_data = blog_list.get(position).getUser_id();
      //  holder.setUserData(user_data);
  
  
      holder.parentLayout.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
              int pos = holder.getAdapterPosition();
  
              //THIS IS WHAT NEEDS TO GET PASSED
              String id = blog_list.get(pos).getPost_id();
  
              /*
              //IMPORTANT
              Intent messageDocIntent = new Intent(mContext, BlogRecyclerAdapter.class);
              messageDocIntent.putExtra("EXTRA_SESSION_ID", message_doc);
              mContext.startActivity(messageDocIntent);
              */
              Toast.makeText(mContext, message_doc, Toast.LENGTH_LONG).show();
  
              // Toast.makeText(mContext, "test " + id, Toast.LENGTH_LONG).show();
  
              Intent intent = new Intent(mContext, Confirmation_Activity.class);
              mContext.startActivity(intent);
  
  
          }
      });
  
  }
  
  @Override
  public int getItemCount() {
      return blog_list.size();
  }
  
  public class ViewHolder extends RecyclerView.ViewHolder {
  
      public Context mContext;
      ConstraintLayout parentLayout;
      private View mView;
      private TextView descView;
      private ImageView blogPostView;
      private TextView blogDate;
      private TextView blogUserName;
      private CircleImageView blogUserImage;
      private StorageReference mImageStorage;
      private TextView userName;
  
  
      @SuppressLint("ResourceType")
      public ViewHolder(View itemView) {
          super(itemView);
          mView = itemView;
          parentLayout = itemView.findViewById(R.id.Main_Blog_Post);
  
      }
  
      public void setDescText(String descText) {
          descView = mView.findViewById(R.id.blog_desc);
          descView.setText(descText);
      }
  
      public void setUserData(String downloadUrl, String name) {
  
          mImageStorage = FirebaseStorage.getInstance().getReference();
  
          mCurrentUser = FirebaseAuth.getInstance().getCurrentUser();
          final String current_uid = mCurrentUser.getUid();
  
          mUserDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(current_uid);
          mUserDatabase.keepSynced(true);
  
          mUserDatabase.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
  
                  String name = Objects.requireNonNull(dataSnapshot.child("name").getValue()).toString();
  
                  StorageReference filepath = mImageStorage.child("profile_images").child(current_uid + (".jpeg"));
                  Log.d("heere", "S");
  
                  // This gets the download url async
                  filepath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener&lt;Uri&gt;() {
                      @Override
                      public void onSuccess(Uri uri) {
  
                          //The download url
                          final String downloadUrl =
                                  uri.toString();
                          Log.d("tag", downloadUrl);
                          if (!downloadUrl.equals("default")) {
  
                              //  Glide.with(getApplicationContext()).load(downloadUrl).into(mDisplayImage);
                              Glide.with(itemView.getContext()).load(downloadUrl).into(blogUserImage);
  
                          }
                      }
                  }).addOnFailureListener(new OnFailureListener() {
                      @Override
                      public void onFailure(@NonNull Exception e) {
                          // Toast.makeText(getApplicationContext(), "Something went wrong", Toast.LENGTH_SHORT).show();
                      }
                  });
                  //Toast.makeText(getApplicationContext(), image, Toast.LENGTH_SHORT).show();
  
                  Log.d("value", dataSnapshot.getValue().toString());
                  Log.d("key", dataSnapshot.getKey());
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
  
              }
          });
  
  
      }
  
      public void setTime(String date) {
  
          blogDate = mView.findViewById(R.id.blog_date);
          blogDate.setText(date);
  
      }
  
      public void setBlogImage(final String downloadUri) {
  
          blogPostView = mView.findViewById(R.id.blog_image);
          Glide.with(itemView.getContext()).load(downloadUri).into(blogPostView);
  
  
      }
  
      public void setBlogUserName(String userName) {
          blogUserName = mView.findViewById(R.id.blog_user_name);
          blogUserName.setText(userName);
      }
  
  
      }
  }
  </code></pre>
  
  <p>If you could point me in the right direction on how to proceed that would be appreciated </p>
  
  <p><strong><em>Current Issue</em></strong></p>
  
  <p><strong>Adapter</strong></p>
  
  <pre><code>    @Override
  public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
  
      String desc_data = blog_list.get(position).getDesc();
      holder.setDescText(desc_data);
  
  
      String user_name = blog_list.get(position).getUser_id();
      holder.setBlogUserName(user_name);
  
      String image_url = blog_list.get(position).getImage_url();
      holder.setBlogImage(image_url);
  
      final String message_doc = blog_list.get(position).getMessage_doc();
  
  
      holder.parentLayout.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              int pos = holder.getAdapterPosition();
  
              Toast.makeText(mContext, message_doc, Toast.LENGTH_LONG).show();
  
              Intent intent = new Intent(mContext, Confirmation_Activity.class);
              intent.putExtra("Message_ID", blog_list.get(pos).getMessage_doc());
              mContext.startActivity(intent);
  
          }
      });
  
  }
  </code></pre>
  
  <p><strong>Activity receiving it</strong></p>
  
  <pre><code>    @Override
  protected void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.chat_activity);
  
      mFirebaseDatabase = FirebaseDatabase.getInstance();
      mMessagedatabaseReference = 
  
  mFirebaseDatabase.getReference().child(messageID());
  ....
  
  
  
      public String messageID(){
      String id = getIntent().getStringExtra("Message_ID");
      return id;
  }
  </code></pre>
  
  <p>If i debug the app in the adapter activity Message_Id is equal to the value from firebase but when i go to launch the new activity the app crashes with</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.debateapp/com.example.android.debateapp.ChatActivity}: java.lang.NullPointerException: Can't pass null for argument 'pathString' in child()
  </code></pre>
  
  <p>with the error pointing to the <code>mMessagedatabaseReference</code> </p>