title: Android: getApplicationContext() won't work in View subclass
body: <p>So i have made a class DrawView which extends View and i want to draw some graph in that class with the points i stored as int array
  i made this array like a sort of public variable with the help of <a href="https://stackoverflow.com/questions/708012/android-how-to-declare-global-variables">How to declare global variables</a> 
  So when i want to get connected with MyApp <strong>in Activity</strong> and change my array, i simply use</p>
  
  <pre><code>MyApp appState = ((MyApp)getApplicationContext());
  </code></pre>
  
  <p>but the problem is that this won't work when i call it in my <strong>DrawView.java</strong> class.
  Any ides how to solve this?</p>