app/src/main/java/org/andstatus/app/context/MyContextHolder.java
/**
     * This allows to refer to the context even before myInitializedContext is initialized.
     * Quickly returns, providing context for the deferred initialization
     */
This allows to refer to the context even before myInitializedContext is initialized.
Quickly returns, providing context for the deferred initialization
This allows to refer to the context even before myInitializedContext is initialized . Quickly returns providing context for the deferred initialization
public MyContextHolder storeContextIfNotPresent(Context context, Object calledBy) {
        if (context == null || getNow().context() != null) return this;
        synchronized(CONTEXT_LOCK) {
            if (myFutureContext.getNow().context() == null) {
                MyContext contextCreator = myFutureContext.getNow().newCreator(context, calledBy);
                requireNonNullContext(contextCreator.context(), calledBy, "no compatible context");
                myFutureContext = MyFutureContext.completed(contextCreator);
            }
        }
        return this;
    }
public MyContextHolder storeContextIfNotPresent ( Context context , Object calledBy ) { if ( context == null || getNow ( ) . context ( ) != null ) return this ; synchronized ( CONTEXT_LOCK ) { if ( myFutureContext . getNow ( ) . context ( ) == null ) { MyContext contextCreator = myFutureContext . getNow ( ) . newCreator ( context , calledBy ) ; requireNonNullContext ( contextCreator . context ( ) , calledBy , "no compatible context" ) ; myFutureContext = MyFutureContext . completed ( contextCreator ) ; } } return this ; }
This allows to refer to the context even before myInitializedContext is initialized.
This allows to refer to the context even before myInitializedContext is initialized .