/***** MainActivity *****/
final Bundle extras = getIntent().getExtras();
mDatalist = extras.getParcelableArrayList(KEY_DATALIST);
mAdapter = new MainAdapter(this, mDatalist);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setAdapter(mAdapter);
/***** CleonActivity *****/
intent.putParcelableArrayListExtra(“KEY_DATALIST”, mDataset);
(***)
It works. I can retrieve the arraylist data from CleonActivity.java to MainActivity.java…
But i have other activities that when i want to intent to MainActivity, the app crash:
Intent intent = new Intent(N1Activity.this, MainActivity.class);
startActivity(intent);
I know its because getIntent() in the MainActivity. How to avoid it? Please help, i am stuck. Thank you.