android - DownloadManager addCompletedDownload() method not working, gives SecurityException -
i using url download , read bytes of data using inputstream, data fetched writing using fileoutputstream in form of pdf. using environment.getexternalstoragepublicdirectory(environment.directory_downloads).tostring();
to write file in downloads folder.
the file gets downloaded in download folder, , can access using filemanager, no issues in that. file not appear in downloads app. so, tried using downloadmanager object
mmanager = (downloadmanager) getsystemservice(context.download_service);
and once download has happened, using
mmanager.addcompleteddownload(filename, "hello", true, "application/pdf", "nn",bufferlength,false);
from sources
now, first query,
i not quite being able understand must mention string path
using line of code, getting securityexception says securityexception invalid value visibility 2 android
any highly appreciated.
securityexceptions usualy rised when dont provide needed permissions.also maybe helpfull : http://technofaq.org/posts/2014/04/fixing-external-sd-card-write-issue-on-android-kitkat/
Comments
Post a Comment