I had to create a "multimap" type data structure for my android app that looks like this
HashMap<Integer, String []> sampleStorage = new HashMap<Integer, String []>
I am trying to pass it through several activities but it fails to pass to the first activity. I know this because the data is available in the activity that it is created but not available in the activity I pass the intent to.
I am using this code to add it to the intent and send it
Intent intent = new Intent(this, MyActivity.class);
Bundle args = new Bundle();
args.putSerializable("sampleStorage", (Serializable)sampleStorage);
intent.putExtra("BUNDLE", args);
And this is the code I am using to retrieve it
Intent intent = getIntent();
Bundle args = intent.getBundleExtra("BUNDLE");
sampleStorage = (HashMap<Integer, String []>) args.getSerializable("sampleStorage");
The error that gets thrown when I try to access it in the second activity is a NullPointerError so it seems like it doesn't even make it to the second activity. Any help will be greatly appreciated, thank you in advance.