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

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

How to hide Android Soft Keyboard