Several classes in Android API require a Context parameter in their constructor, for example ArrayAdapter, SQLiteOpenHelper or Intent. When creating such an object from inside an Activity, what context instance is more appropriate to pass to them: this (the activity instance itself) or the object returned by the activity’s getApplicationContext() method and why?
Up to now, I have used both and didn’t see any difference in the resulting functionality. Is there any rule of thumb?
From the docs of
getApplicationContext()method: