koin
Koin how to inject outside of Android activity / appcompatactivity
There is the KoinComponent which comes to the rescue. In any class you can simply: class SampleClass : KoinComponent { val a : A? by inject() val b : B? by inject() } Extending KoinComponent gives you access to inject() method. Remember that usually it’s enough to inject stuff the usual way: class SampleClass(val a … Read more
Pass data back to previous fragment using Android Navigation
Android just released a solution for this; Passing data between Destinations (Navigation 2.3.0-alpha02), basically, in fragment A you observe changes in a variable and in fragment B you change that value before executing popBackStack(). Fragment A: findNavController().currentBackStackEntry?.savedStateHandle?.getLiveData<String>(“key”)?.observe(viewLifecycleOwner) { result -> // Do something with the result. } Fragment B: navController.previousBackStackEntry?.savedStateHandle?.set(“key”, result) navController.popBackStack()
java.lang.NoSuchMethodError: No virtual method elapsedNow()D in class Lkotlin/time/TimeMark
Apparently this issue is due to the usage of androidLogger() together with Koin. There is only a workaround for now, which is migrating from androidLogger() to androidLogger(Level.ERROR) There is already an issue created for this purpose: https://github.com/InsertKoinIO/koin/issues/847