title: Application + Activity + onResume == NULL POINTER EXCEPTION
body: <p>So I am having problem I just can't get my head around in Android.</p>
  
  <p>My program uses the Application class for storing globals.</p>
  
  <p>In there I have the following</p>
  
  <pre><code>public ExampleClass SetOfExamples[];
  
  @Override
  public void onCreate() {
      super.onCreate();
      _appCtrl = this;
      SetOfExamples = new ExampleClass[10];
      // ARRAY IS INITED HERE - all entrys are setup.
  }
  </code></pre>
  
  <p>then in an activity I have</p>
  
  <pre><code>protected void onResume() {
      super.onResume();
      appState = ((MyApplication)this.getApplication());    
      if(appState!=null)
      {
          if(appState.SetOfExamples[1]!=null)
          {
              // Do stuff
          }
          else
          {
              // What do I do ???
          }
      }
  
  }
  </code></pre>
  
  <p>Quite often in a deployed app (but never can reproduce myself!!!), it is falling into the "What do I do" portion of the code.</p>
  
  <p>So why is this ? , how can my activity be resumed before myapplication create is called ?
  Or is the array being created by myapplication being deallocated ? , if so how to do I prevent that - I thought it was supposed to stay there as it's part of the global application context.</p>
  
  <p>ADDITIONAL INFO: This activity IS the launch activity.</p>