When I’am inside a fragment what is the difference between this.context
and this.activity
Eg:
val intent = Intent(this.activity!! , Activity::class.java)
val intent = Intent(this.context!! , Activity::class.java)
When I’am inside a fragment what is the difference between this.context
and this.activity
Eg:
val intent = Intent(this.activity!! , Activity::class.java)
val intent = Intent(this.context!! , Activity::class.java)
with context > intent exists as long as application exists
with activity > intent exists as long as the activity exists
now you know what you need most of the cases.. :-D