android - Error: cannot find symbol method canDrawOverlays(Context) -


sorry if blatantly obvious issue resolution. can't seem figure out how fix it.

i'm importing.

import android.provider.settings; 

and attempting run code snippet below in activities, application, broadcast receivers, etc. works fine in paid version of app. when copy code out free version , paste in(same machine, same sdk) compiler goes red.

boolean candrawoverlays;  if(build.version.sdk_int >= 23) {     candrawoverlays = settings.candrawoverlays(getapplicationcontext()); } 

solved. blatantly obvious. save time , trouble in future of overlooked project setting.

  • right click project.
  • goto module settings.
  • goto compile sdk version.
  • set api level appropriate. in case @ level 19 , needed 23 candrawoverlays coming through.
  • alternatively open project's build.gradle , set compilesdkversion there.

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo