I have to access the Context
in different package. The thing which I am achieving is that I want to save a Integer value
in Preferences
and want to get the value in different package. Is there any way to achieve this? Actually, there is an asynchronous method which is being used in different package, and I want to do some processing before call come back to my package? How can I achieve this?
Asked
Active
Viewed 1,174 times
0

Mustansar Saeed
- 2,730
- 2
- 22
- 46
-
1Show us your code please. – AlbAtNf Feb 10 '16 at 11:21
-
2As long as it is inside the same application, the Context will be the same... – Fustigador Feb 10 '16 at 11:25
-
how to use it in other package as `getApplicationContext()` does not work in Different package – Mustansar Saeed Feb 10 '16 at 11:51
1 Answers
1
getApplicationContext() will return you the context in application level. If you want to get the context is Activity level just use "ActivityName.this" or if its in fragment use getActivity()

Vivek C A
- 1,045
- 1
- 8
- 14