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

Popular posts from this blog

Offers on Friday, April 24, 2020

Fatal: LoadModule: error loading module 'mod_sql_mysql.c'