title: Android array as global variable
body: <p>I know how to pass a variable from one activity to another using global variables.</p>
  
  <p>e.g.
  In one.java:</p>
  
  <pre><code>   GlobalVars.setColour(0);
  </code></pre>
  
  <p>In two.java:</p>
  
  <pre><code> if (GlobalVars.getColour() == 0) ...
  </code></pre>
  
  <p>GlobalVariables.java:</p>
  
  <pre><code> private static int colour2;
  
      public static int getColour() {
          return colour2;
      }
  
      public static void setColour(int colour) {
          colour2 = colour;
      }
  </code></pre>
  
  <p>What if i have an array in one.java and i need it in another class?</p>
  
  <pre><code> ArrayList&lt;String&gt; myArr = new ArrayList&lt;String&gt;();
  </code></pre>
  
  <p>myArr is uploaded with contacts from the phone book of the phone, so it is dynamic. I need it to upload a ListView with its elements in a custom dialog class. How to pass it to another activity/dialog? </p>