1
What’s the difference between ActivityContext
and ApplicationContext
?
The following code, executed from a Fragment
, log the message "are different":
if (getActivity().getApplicationContext().equals(getContext())) {
Log.d("Context", "São iguais");
} else {
Log.d("Context", "São diferentes");
}
The two compared methods return an instance of Context
. If the Context
are different, so each of them serves?