How use getContentResolver in a class without activity?
In android development, methods like getContentResolver() need context to call these kinds of methods. But some classes does not have Context. In those cases it is used like this.
- Application: getApplicationContext()
- Activity: this (as Activity extends Context)
- Fragment: getActivity()
Comments
Post a Comment