I am using an url to download and read bytes of data using InputStream, the data thus fetched I am writing using a FileOutputStream in form of a pdf. Then I am using Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString();
to write the file in the downloads folder.
The file gets downloaded in the Download folder, and I can access it using FileManager, no issues in that. But the file does not appear in the Downloads app. So, I tried by using DownloadManager object
mManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
and once the download has happened, I am using
mManager.addCompletedDownload(fileName, "Hello", true, "application/pdf", "nn",bufferLength,false);
from sources
Now, my first query,
I am not quite being able to understand what I must mention for String path
Using this line of code, I am getting an SecurityException which says securityexception invalid value for visibility 2 android
Any help is highly appreciated.