android, getContentResolver() outside Activity
getContentResolver() is a method of Context, so my guess is that your class is not derived fromActivity (which is derived from Context).
You have to use a context variable if you want to call it outside of an activity class (context.getContentResolver()). If your class is a BroadcastReceiver then the context variable is given as an argument in onReceive(). If not, you have to send it to your method when you call it.
 
                     
                    
                 
                    
                 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号