Paul Dhaliwal08/07/2019, 8:13 PM
which gives the error “type mismatch Required Context, Found Context?” I can get around this error by using “context as Context” or “context!!“, however these don’t feel like the right approaches. The Kotlin doc says !! is for “NPE-lovers” which I am not lol. What’s the best way to handle these situations? I’m still new to Kotlin and development in general and don’t want to develop any bad habits. Thanks!
jw08/07/2019, 8:14 PM
is fine. there's probably also
wherever you're calling this from
Paul Dhaliwal08/07/2019, 8:40 PM
Aslam Hossin08/08/2019, 2:10 AM
jw08/08/2019, 2:18 AM
in that case. But that seems exceedingly unlikely and even in the case where it is likely you probably want to fix your design so that the code bails much earlier.
ahulyk08/09/2019, 12:44 PM
is better than
from my point of view