public boolean runOnFirstFix ( final Runnable runnable ) { if ( mMyLocationProvider != null && mLocation != null ) { new Thread ( runnable ) . start ( ) ; return true ; } else { mRunOnFirstFix . addLast ( runnable ) ; return false ; } }
Queues a runnable to be executed as soon as we have a location fix . If we already have a fix we ll execute the runnable immediately and return true . If not we ll hang on to the runnable and return false ; as soon as we get a location fix we ll run it in in a new thread .