0

I'm wondering what the difference between all those methods: getApplication(), getApplicationContext(), getActivity() is. I use it fairly often for toasts and stuff but only know which one to choose because of the IDE-help.

Philip
  • 1,068
  • 3
  • 12
  • 21

1 Answers1

1

You should rather try to understand what is the difference between Application, Activity and Context. All the 3 concepts are well documented in the Android official documentation.

To be fair, the meaning of context is not so clear from the documentation, so here is a short explanation and here is a long one

Community
  • 1
  • 1
Thomas
  • 2,751
  • 5
  • 31
  • 52