title: Pass data recycler adapter to other activity using Firebase
body: <p>Image : </p>
  
  <p><img src="https://i.stack.imgur.com/sCByV.jpg" alt="enter image description here"></p>
  
  <p>I am using Firebase for video status android application, and using recycler view but Firebase daat will not pass first activity to another (second) activity, how I can solve this problem (error)<br>
  error Model.videolink' on a null object reference.</p>
  
  <p><strong>App Adepter</strong></p>
  
  <pre><code>public class App_Adepter extends RecyclerView.Adapter&lt;App_Adepter.ViewHolder&gt; {
  
  Model model;
  private Context context;
  private ArrayList&lt;Model&gt; uploads;
  private ProgressDialog pDialog;
  private MediaController mediaController;
  
  class ViewHolder extends RecyclerView.ViewHolder {
      public ImageView imageView;
      public VideoView videoView;
      public TextView textView;
  
      public ViewHolder(View itemView) {
          super(itemView);
          imageView = (ImageView) itemView.findViewById(R.id.rImageView);
          videoView = (VideoView) itemView.findViewById(R.id.test_video);
          textView = (TextView) itemView.findViewById(R.id.text11);
      }
  }
  
  public App_Adepter(Context context, ArrayList&lt;Model&gt; uploads) {
      this.uploads = uploads;
      this.context = context;
  }
  
  @Override
  public App_Adepter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View v = LayoutInflater.from(parent.getContext())
              .inflate(R.layout.row, parent, false);
      return new App_Adepter.ViewHolder(v);
  }
  
  @Override
  public void onBindViewHolder(final App_Adepter.ViewHolder holder, final int position) {
      final Model upload = uploads.get(position);
  
  
      /*Video Click*/
      holder.itemView.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Intent intent = new Intent(context, Full_video.class);
              intent.putExtra("posss", model.image);
              intent.putParcelableArrayListExtra("Category", uploads);
              intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              context.startActivity(intent);
  
          }
      });
  
      final MediaController mediaController = new MediaController(context);
  
      String uriPath = upload.getImage();  //update package name
      Uri uri = Uri.parse(uriPath);
  
  
      holder.textView.setText(upload.getVideolink());
      Glide.with(context).load(upload.getImage()).into(holder.imageView);
  
  
      holder.videoView.setVideoURI(uri);
  
      holder.videoView.start();
  
      holder.videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
          @Override
          public boolean onError(MediaPlayer mp, int what, int extra) {
              return true;
          }
      });
  
      holder.videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
          @Override
          public void onPrepared(MediaPlayer mp) {
              mp.setOnVideoSizeChangedListener(new MediaPlayer.OnVideoSizeChangedListener() {
                  @Override
                  public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
  
                      /**** Media control coding ****///
                     holder.videoView.setMediaController(mediaController);
                     mediaController.setAnchorView(holder.videoView);
                      mp.setVolume(0, 0);
  
                  }
              });
          }
      });
  
  }
  
  
  @Override
  public long getItemId(int position) {
      return position;
  }
  
  @Override
  public int getItemCount() {
      return uploads.size();
  }
  
  }
  </code></pre>
  
  <p><strong>Model Class</strong></p>
  
  <pre><code>String image;
  String videolink;
  
  public Model() {
  }
  
  public static Creator&lt;Model&gt; getCREATOR() {
  
      return CREATOR;
  }
  
  public Model(String image,String videolink) {
  
      this.videolink = videolink;
      this.image = image;
  }
  
  protected Model(Parcel in) {
      image = in.readString();
      videolink = in.readString();
  }
  
  public static final Creator&lt;Model&gt; CREATOR = new Creator&lt;Model&gt;() {
      @Override
      public Model createFromParcel(Parcel in) {
          return new Model(in);
      }
  
      @Override
      public Model[] newArray(int size) {
          return new Model[size];
      }
  };
  
  public String getVideolink() {
      return videolink;
  }
  
  public void setVideolink(String videolink) {
      this.videolink = videolink;
  }
  
  public String getImage() {
      return image;
  }
  
  public void setImage(String image) {
      this.image = image;
  }
  
  
  @Override
  public int describeContents() {
      return 0;
  }
  
  @Override
  public void writeToParcel(Parcel dest, int flags) {
      dest.writeString(image);
      dest.writeString(videolink);
  }
  </code></pre>
  
  <p><strong>Other (Second) Activity</strong></p>
  
  <pre><code>    Bundle extra = getIntent().getExtras();
      String value = extra.getString("posss");
  
      videoView.setVideoURI(Uri.parse(value));
  </code></pre>
  
  <p><strong>First Activity</strong></p>
  
  <pre><code>    mDatabase.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot snapshot) {
              progressDialog.dismiss();
  
              for (DataSnapshot postSnapshot : snapshot.getChildren()) {
                  Model upload = postSnapshot.getValue(Model.class);
                  app_models.add(upload);
              }
  
              adapter = new App_Adepter(App_screen.this, app_models);
              recyclerView.setAdapter(adapter);
  
              if (app_models.size() &lt;= 0) {
                  textView.setVisibility(View.VISIBLE);
              } else {
                  textView.setVisibility(View.GONE);
              }
          }
  </code></pre>