I have Arraylist private ArrayList<Movies> mMovies; of type Movies which is implemented as Parcelable defined in MainActivity.
mMovies contains list of movies around 20.
within MainActivity inside onCreateView() method
I tried to pass the parcelable objects to another Activity called DetailActivity
Intent intent = new Intent(getActivity(), DetailActivity.class);
intent.putExtra("MOVIES", movieList);
startActivity(intent);
Using debugger i can see the movieList contains 20 rows.
This is how i tried to read parcelable objects which was passed through intents from MainActivity.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bundle = getActivity().getIntent().getExtras();
mMovies = getActivity().getIntent().getParcelableExtra("MOVIES");
}
While i try to see the mMovies value using debugger it shows null
