title: Sending a MultiMap type datastructure through an intent in android studio
body: <p>I had to create a "multimap" type data structure for my android app that looks like this </p>
  
  <pre><code>HashMap&lt;Integer, String []&gt; sampleStorage = new HashMap&lt;Integer, String []&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>I am using this code to add it to the intent and send it</p>
  
  <pre><code>Intent intent = new Intent(this, MyActivity.class);
  
  Bundle args = new Bundle();
  args.putSerializable("sampleStorage", (Serializable)sampleStorage);
  intent.putExtra("BUNDLE", args);
  </code></pre>
  
  <p>And this is the code I am using to retrieve it</p>
  
  <pre><code>Intent intent = getIntent();
  Bundle args = intent.getBundleExtra("BUNDLE");
  
  sampleStorage = (HashMap&lt;Integer, String []&gt;) args.getSerializable("sampleStorage");
  </code></pre>
  
  <p>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.</p>