@SuppressLint("NewApi") public static String saveMediaIntoDownloads(Context context,File srcFile,String filename,String mimeType){
  String fullFilePath=saveFileInto(srcFile,Environment.DIRECTORY_DOWNLOADS,filename);
  if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    if (null != fullFilePath) {
      DownloadManager downloadManager=(DownloadManager)context.getSystemService(Context.DOWNLOAD_SERVICE);
      try {
        File file=new File(fullFilePath);
        downloadManager.addCompletedDownload(file.getName(),file.getName(),true,mimeType,file.getAbsolutePath(),file.length(),true);
      }
 catch (      Exception e) {
        Log.e(LOG_TAG,"## saveMediaIntoDownloads(): Exception Msg=" + e.getMessage());
      }
    }
  }
  return fullFilePath;
}

@ SuppressLint ( "NewApi" ) public static String saveMediaIntoDownloads ( Context context , File srcFile , String filename , String mimeType ) { String fullFilePath = saveFileInto ( srcFile , Environment . DIRECTORY_DOWNLOADS , filename ) ; if ( android . os . Build . VERSION . SDK_INT >= Build . VERSION_CODES . HONEYCOMB ) { if ( null != fullFilePath ) { DownloadManager downloadManager = ( DownloadManager ) context . getSystemService ( Context . DOWNLOAD_SERVICE ) ; try { File file = new File ( fullFilePath ) ; downloadManager . addCompletedDownload ( file . getName ( ) , file . getName ( ) , true , mimeType , file . getAbsolutePath ( ) , file . length ( ) , true ) ; } catch ( Exception e ) { Log . e ( LOG_TAG , "## saveMediaIntoDownloads(): Exception Msg=" + e . getMessage ( ) ) ; } } } return fullFilePath ; }
save a media uri into the download directory
