Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This will not work because the <code>Object</code> class in Java is not serializable. See <a href="https://stackoverflow.com/questions/11600213/why-doesnt-java-lang-object-implement-the-serializable-interface">this question</a> for an explanation as to why.</p> <p>The <code>Intent.putExtra()</code> method requires a type that implements the serializable interface, Object does not implement this so consequently it will not work. I would suggest rather than having a <code>HashMap&lt;String,Object&gt;</code> you replace the Object with a more specific type that implements the Serializable interface. See this <a href="http://www.tutorialspoint.com/java/java_serialization.htm" rel="nofollow noreferrer">tutorial</a> for how to do this.</p> <p><strong>UPDATE</strong></p> <p>If the data you are passing is large there could be a fairly significant overhead associated with serializing and deserializing. Consequently it might be worth using a Static Singleton class to store the arraylist. The code sample below shows how you could implement this:</p> <pre><code>public class DataStore { private static final DataStore instance = new DataStore (); private arraylist = new ArrayList&lt;HashMap&lt;String,Object&gt;&gt;(); //Private constructor private DataStore () {} //Class is only accessible through this method public static Singleton getInstance() { return instance; } //Accessors for your data private ArrayList&lt;HashMap&lt;String,Object&gt;&gt; getArrayList() { return arraylist; } private void setArrayList(ArrayList&lt;HashMap&lt;String,Object&gt;&gt; value) { arraylist = value; } } </code></pre> <p>For reference here is a <a href="http://howtodoinjava.com/2012/10/22/singleton-design-pattern-in-java/" rel="nofollow noreferrer">tutorial</a> on static singletons.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload