File saved in downloads but does not appear in Download app
<p>I am saving an image in download but when i open the download apps i don't the see the file. I tried using MediaScannerConnection to scan but still it does not appear.here is my code. please help</p>

<pre><code> private void createPNGFile()
    {
        File downloadPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
        File createPNGImage = new File(downloadPath.getAbsolutePath(),"image.png");

        try {
            InputStream is;
            is = getResources().openRawResource(R.raw.icon);
            OutputStream os = new FileOutputStream(createPNGImage);
            byte[] data = new byte[is.available()];
            is.read(data);

            os.write(data);
            is.close();
            os.close();
            Toast.makeText(this, "File Created (Path): " + createPNGImage.getAbsolutePath(), Toast.LENGTH_LONG).show();
            scanFiles(createPNGImage);
}catch(IOException e)
{
}

}

private void scanFiles(final File fileObj)
{
        MediaScannerConnection.scanFile(this, new String[]{

                        fileObj.getAbsolutePath()},

                null, new MediaScannerConnection.OnScanCompletedListener() {

                    public void onScanCompleted(String path, Uri uri)

                    {

                        Log.d("Media Scan", "Scan Completed" + fileObj.getAbsolutePath());
                    }

                });

}
</code></pre>