Are activity contexts / Android applications / services of the same object if they belong to the same application?

Can we assume that getApplicationContext in the application and getContext in AbstractThreadedSyncAdapter returns the same object? How about another case where we get context from activity, service ... all belong to the same application. Thanks.

+4
source share
1 answer

No, it is not. Here is the trick:

- singleton, . getApplication() Activity Service getApplicationContext() . , .

Activity/Service - ContextWrapper, API, - , . , framework Activity Service, ContextImpl, , . , .

: https://possiblemobile.com/2013/06/context/

+3

All Articles