Or should I make an extension function for Activity and Fragment to cover both cases?
t
tseisel
05/09/2019, 3:27 PM
I find it safer to define a separate extension for
Activity
and
Fragment
, as
Context
can also refer to the application context. Not sure that using the application context would prevent from showing the toast, but UI things should be called from UI code.
👍 1
s
Sam
05/09/2019, 4:00 PM
If possible, try to get away from Toast. android core ktx used to have this extension and it got removed a while back