Closed baruchn closed 5 years ago
Describe the bug The following code:
import android.content.Context; import android.util.Log; import kotlin.Lazy; import static org.koin.java.KoinJavaComponent.*; class DITest { private static final String TAG = DITest.class.getSimpleName(); private Lazy<Context> context = inject(Context.class); void test() { Log.d(TAG, "test: get context is " +get(Context.class)); Log.d(TAG, "test: injected context is " +context); } }
Results in:
test: get context is android.app.Application@c56973c test: injected context is Lazy value not initialized yet.
Using koin-java version 2.0.1.
koin-java
2.0.1
Sorry, was missing getValue() call.
Describe the bug The following code:
Results in:
Using
koin-java
version2.0.1
.