Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Answer here?</p> <p><a href="https://stackoverflow.com/questions/6714456/add-item-to-listview-after-passing-info-through-an-intent-android/6714690#6714690">Activity Result Fix</a></p> UPDATE: <p>After that you will need to cache the information on the device and set it to refresh. in onClose() serialize the painItems ArrayList to a file using FileOutputStream fed by ObjectOutputStream to write your list out to a file. Use ObjectInputStream from a FileInputStream to read it back in. I recommend doing this in onPostResume() and notify the empty initialized adapter of the data set change.</p> UPDATE 2: <p>The shamelessly terse Exception handling below needs to be thought out but this should get you started.</p> <pre><code>String serfilename = "painitems.ser"; ... private ArrayList&lt;HashMap&lt;String, String&gt;&gt; loadListFromFile( ArrayList&lt;HashMap&lt;String, String&gt;&gt; masterlistrev) { try { FileInputStream fis = openFileInput(serfilename); ObjectInputStream ois = new ObjectInputStream(fis); masterlistrev = (ArrayList&lt;HashMap&lt;String, String&gt;&gt;) ois.readObject(); } catch (Exception e) { e.printStackTrace(); } return masterlistrev; } private void writeListToFile(ArrayList&lt;HashMap&lt;String, String&gt;&gt; masterlistrev){ File myfile = getFileStreamPath(serfilename); try { if(myfile.exists() || myfile.createNewFile()){ FileOutputStream fos = openFileOutput(serfilename, MODE_PRIVATE); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(masterlistrev); } } catch (Exception e) { e.printStackTrace(); } } </code></pre>
    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