title: Android Google Maps Api v2 current Location Null
body: <p>Good Day.Im trying to get current location with <code>map.getMyLocation()</code> but surely I'm getting NullPointerException as my location isn't loaded for a while.So I'm doing a MapReady check and MapLoaded check which both triggers once map ready and its loaded,but unfortunately  what about my current location,it seems that i will never know when its available.Here is a snippet of my code which i though might do normal null check.</p>
  
  <pre><code>            @Override
                      public void onMapLoaded() {
          //here my map is loaded so this triggers.
      if(map.getMyLocation()!=null){
  //do something here. 
  
      }
          }
  </code></pre>
  
  <p>but it seems that my null check will never work as just because once my above written method triggers it dont wait for my if condition its just checks if it is not satisfying my if condition just going over it so my if condition never triggers.Problem is that how can i be notified when my location is enabled?I tried even to put this into loop of <code>while()</code> but its freezes if i do on <code>UI thread</code> and won't let me do anything if i do on a <code>THREAD</code> as google maps need to be done on <code>MainThread</code>.So my question is next,how in world i can be notified whether my location is null,or not?And how can i trigger some piece of code once its not <code>NULL</code>?</p>