Search code examples
androidandroid-4.4-kitkat

Context.getExternalFilesDirs(null) is not defined


I am trying context.getExternalFilesDirs(null) to get paths for mounted storages. I intend to use this method keeping in view the new restrictions imposed by android in Kitkat. When I write statement to make a call to the method it gets underlined in RED with message as shown in image below:

enter image description here

I have checked all installations required to support API level 19 and everything seems fine. enter image description here

My application is targeted for API 19 with minimum sdk version set to 16. enter image description here

I have checked it a lot and looks like no one has faced this issue. I don't know what can possibly go wrong here but if you have any idea that where I am doing wrong please identify. Thank you


Solution

  • This is how I resolved the above issue.Right side click on Project -> Properties -> Android -> set Project Build Target to > Android 4.4.2 -> Apply