0

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?

Mustansar Saeed
  • 2,730
  • 2
  • 22
  • 46

1 Answers1

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