I need to get a Context from my activity. When i do that using:
override fun getContext(): Context {
return activity.applicationContext
}
i got:
safe ( .) or non-null asserted ( .) calls are allowed on a nullable receiver of type FragmentACtivity
activityis calling your fragment'sgetActivity()which isn't guaranteed to not be null. So you'll have to doactivity!!.applicationContext!!ALT+ENTERto get a solution to fix your problem - more often than not, it's Kotlin telling you to be hyper-conscious about nullability