title: using static variables in android
body: <p>In my mainActivity I declare static List like this:</p>
  
  <pre><code>public static List&lt;Map&lt;String, String&gt;&gt; ArrList = new ArrayList&lt;Map&lt;String, String&gt;&gt;();
  </code></pre>
  
  <p>Then in other activities I access this list with mainActivity.ArrList ...
  I am almost sure that I am not supposed to do this, but anyway, I would like to understand all of it a little bit better...</p>
  
  <p>So, here are my questions:
  1) As far as I know, due to low memory or something, my mainActivity could get destroyed (while another activity is in focus) and in that case my ArrList would get destroyed too. Is that right?
  2) Whene I exit, then restart, my app crashes and debugger reports OutOfMemory. I assume upon restart android allocates another block of memory for my static List. So, I also assume that I should destroy static List when Activity ends. How to do that properly?</p>
  
  <p>I appreciate any other advice about this matter.</p>