title: Null object when retrieved via parcelableextra via intent
body: <p>Building a MoviesDB app that calls api and retrieves data to display popular movies after building the initial grid layout etc and calling api I've built another activity to display the clicked item. I just want to log some data before I code the activity but it returns null. It's a custom Movie object. I've read around a bit and it seems a problem with the ordering of parcelable in the Movie.class but I'm unsure.</p>
  
  <p>please help (if you  could elaborate as well that would be great)</p>
  
  <pre><code>public class MovieActivity extends AppCompatActivity {
  
      private Movie movie;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_movie);
  //        getSupportActionBar().setTitle("Movie");
  //        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  
          Intent intent = getIntent();
  
          if(intent.hasExtra("movie")) {
              movie = intent.getParcelableExtra("movie");
              Toast.makeText(getApplicationContext(), movie.getOriginalTitle(), Toast.LENGTH_LONG).show();
          }
      }
  
  }
  </code></pre>
  
  <hr>
  
  <pre><code>public class MovieAdapter extends RecyclerView.Adapter&lt;MovieAdapter.MovieViewHolder&gt; {
  
      private Context context;
      private ArrayList&lt;Movie&gt; movieArrayList;
  
      public MovieAdapter(Context context, ArrayList&lt;Movie&gt; movieArrayList) {
          this.context = context;
          this.movieArrayList = movieArrayList;
      }
  
      @NonNull
      @Override
      public MovieViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
  
  
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.movie_list_item, parent, false);
          return new MovieViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(@NonNull MovieViewHolder holder, int position) {
  
          holder.movieTitle.setText(movieArrayList.get(position).getOriginalTitle());
          holder.rate.setText(Double.toString(movieArrayList.get(position).getVoteAverage()));
  
          String imagePath = "https://image.tmdb.org/t/p/w500" + movieArrayList.get(position).getPosterPath();
  
          Glide.with(context)
                  .load(imagePath)
                  .placeholder(R.drawable.loading)
                  .into(holder.movieImage);
  
  
      }
  
      @Override
      public int getItemCount() {
          return movieArrayList.size();
      }
  
  
      public class MovieViewHolder extends RecyclerView.ViewHolder {
  
  
          public TextView movieTitle, rate;
          public ImageView movieImage;
  
          public MovieViewHolder(View itemView) {
              super(itemView);
  
              movieImage = (ImageView) itemView.findViewById(R.id.ivMovie);
              rate = (TextView) itemView.findViewById(R.id.tvRating);
              movieTitle = (TextView) itemView.findViewById(R.id.tvTitle);
  
              itemView.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View view) {
  
                      int position = getAdapterPosition();
  
                      if (position != RecyclerView.NO_POSITION) {
  
                          Movie selctedMovie = movieArrayList.get(position);
  
                          Intent intent = new Intent(context, MovieActivity.class);
                          intent.putExtra("movie", selctedMovie);
                          context.startActivity(intent);
  
  
                      }
  
  
                  }
              });
  
  
          }
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>public class Movie implements Parcelable
  {
  
      @SerializedName("vote_count")
      @Expose
      private Integer voteCount;
      @SerializedName("id")
      @Expose
      private Integer id;
      @SerializedName("video")
      @Expose
      private Boolean video;
      @SerializedName("vote_average")
      @Expose
      private Double voteAverage;
      @SerializedName("title")
      @Expose
      private String title;
      @SerializedName("popularity")
      @Expose
      private Double popularity;
      @SerializedName("poster_path")
      @Expose
      private String posterPath;
      @SerializedName("original_language")
      @Expose
      private String originalLanguage;
      @SerializedName("original_title")
      @Expose
      private String originalTitle;
      @SerializedName("genre_ids")
      @Expose
      private List&lt;Integer&gt; genreIds = null;
      @SerializedName("backdrop_path")
      @Expose
      private String backdropPath;
      @SerializedName("adult")
      @Expose
      private Boolean adult;
      @SerializedName("overview")
      @Expose
      private String overview;
      @SerializedName("release_date")
      @Expose
      private String releaseDate;
      public final static Parcelable.Creator&lt;Movie&gt; CREATOR = new Creator&lt;Movie&gt;() {
  
  
          @SuppressWarnings({
                  "unchecked"
          })
          public Movie createFromParcel(Parcel in) {
              return new Movie(in);
          }
  
          public Movie[] newArray(int size) {
              return (new Movie[size]);
          }
  
      }
              ;
  
      protected Movie(Parcel in) {
          this.voteCount = ((Integer) in.readValue((Integer.class.getClassLoader())));
          this.id = ((Integer) in.readValue((Integer.class.getClassLoader())));
          this.video = ((Boolean) in.readValue((Boolean.class.getClassLoader())));
          this.voteAverage = ((Double) in.readValue((Double.class.getClassLoader())));
          this.title = ((String) in.readValue((String.class.getClassLoader())));
          this.popularity = ((Double) in.readValue((Double.class.getClassLoader())));
          this.posterPath = ((String) in.readValue((String.class.getClassLoader())));
          this.originalLanguage = ((String) in.readValue((String.class.getClassLoader())));
          this.originalTitle = ((String) in.readValue((String.class.getClassLoader())));
          in.readList(this.genreIds, (java.lang.Integer.class.getClassLoader()));
          this.backdropPath = ((String) in.readValue((String.class.getClassLoader())));
          this.adult = ((Boolean) in.readValue((Boolean.class.getClassLoader())));
          this.overview = ((String) in.readValue((String.class.getClassLoader())));
          this.releaseDate = ((String) in.readValue((String.class.getClassLoader())));
      }
  
      public Movie() {
      }
  
      public Integer getVoteCount() {
          return voteCount;
      }
  
      public void setVoteCount(Integer voteCount) {
          this.voteCount = voteCount;
      }
  
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  
      public Boolean getVideo() {
          return video;
      }
  
      public void setVideo(Boolean video) {
          this.video = video;
      }
  
      public Double getVoteAverage() {
          return voteAverage;
      }
  
      public void setVoteAverage(Double voteAverage) {
          this.voteAverage = voteAverage;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
      public Double getPopularity() {
          return popularity;
      }
  
      public void setPopularity(Double popularity) {
          this.popularity = popularity;
      }
  
      public String getPosterPath() {
          return posterPath;
      }
  
      public void setPosterPath(String posterPath) {
          this.posterPath = posterPath;
      }
  
      public String getOriginalLanguage() {
          return originalLanguage;
      }
  
      public void setOriginalLanguage(String originalLanguage) {
          this.originalLanguage = originalLanguage;
      }
  
      public String getOriginalTitle() {
          return originalTitle;
      }
  
      public void setOriginalTitle(String originalTitle) {
          this.originalTitle = originalTitle;
      }
  
      public List&lt;Integer&gt; getGenreIds() {
          return genreIds;
      }
  
      public void setGenreIds(List&lt;Integer&gt; genreIds) {
          this.genreIds = genreIds;
      }
  
      public String getBackdropPath() {
          return backdropPath;
      }
  
      public void setBackdropPath(String backdropPath) {
          this.backdropPath = backdropPath;
      }
  
      public Boolean getAdult() {
          return adult;
      }
  
      public void setAdult(Boolean adult) {
          this.adult = adult;
      }
  
      public String getOverview() {
          return overview;
      }
  
      public void setOverview(String overview) {
          this.overview = overview;
      }
  
      public String getReleaseDate() {
          return releaseDate;
      }
  
      public void setReleaseDate(String releaseDate) {
          this.releaseDate = releaseDate;
      }
  
      public void writeToParcel(Parcel dest, int flags) {
          dest.writeValue(voteCount);
          dest.writeValue(id);
          dest.writeValue(video);
          dest.writeValue(voteAverage);
          dest.writeValue(title);
          dest.writeValue(popularity);
          dest.writeValue(posterPath);
          dest.writeValue(originalLanguage);
          dest.writeValue(originalTitle);
          dest.writeList(genreIds);
          dest.writeValue(backdropPath);
          dest.writeValue(adult);
          dest.writeValue(overview);
          dest.writeValue(releaseDate);
      }
  
      public int describeContents() {
          return 0;
      }
  
  }
  </code></pre>
  
  <p>Its hard for me to understand because I expected that by using putExtra and passing the movie object on calling the getIntent and trying to retrieve the data it would return null but after a lot of debugging I can see that its null the object I've passed which leads me to believe somewhere the parcelable isn't correct.  </p>
  
  <p>In the MainActivity all films are displayed so its not an issue with the api key.</p>
  
  <p>Thanks in  advance.</p>