ibrahim yener wrote:Hello guys
I want to know what is the difference between this, ClassName.this, getApplicationContext, getBaseContext and getContext.
Why there is so many type. What is their specific tasks.
When to use?
How to use?
Why to use? :)
Thanks for any information
Regards
Steve
ibrahim yener wrote:Dear Steve
Thank you so much for this valuable information and taking your time.
Much appreciated.
So far, what did i understand is that Context holds the Activity objects and tells to another activity Where is it in the memory.
Bigger context cover more information about Application.
Not sure about 'necessary' or not... but most likely you want the Activity's context, because the narrower scope gives you access to what is more likely to be needed. I don't think the analogy to the excessive waste in water is applicable - the Application context exists, has information, and you using it doesn't change its size or content. Nor does it give you access to an excess of information. It just might not be the right scope to look at... or it might be depending on needs.Using getApplicationContext for onClickListener or inner class is unnecessary isn't it?
It's more like filling bathtub for brushing teeth.
Steve