我正在創建一個應用程序,可以從互聯網下載圖像!圖像下載沒有問題!但問題是,他們被下載到一個未知的文件夾中,並且下載的圖片在圖庫應用程序中看不到! 如何下載特定圖庫文件夾中的圖像,以便在圖庫中可見? 在此先感謝!從Android中的特定位置的URL保存圖像
下載方法:
DownloadManager dm = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
Uri uri = Uri.parse(url);
DownloadManager.Request request = new DownloadManager.Request(uri);
request.setDescription("Downloading Wallpaper").setTitle("Downloading");
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
myDownloadReference = dm.enqueue(request);
Toast.makeText(Wallpaper.this, "Downloading..", Toast.LENGTH_SHORT).show();
}
問題中的代碼沒有「位圖」。 – CommonsWare
@CommonsWare將圖像url轉換爲bitmap.check編輯後的ans – susaine