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

There was a problem saving your changes. Please try again later.

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