I have managed to download my video on the device, but cannot access it again to play it on my app. I am using the generated uri to reference my video back to the videoView, but the uri generated at
uri= downloadManager.getUriForDownloadedFile(reference); is null according my my log message.
What am I doing wrong?
public void saveLocal(View v){
downloadManager= (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
String url= "http://adme360.otscom.net/tim10.mp4";
uris= Uri.parse(url);
DownloadManager.Request request= new DownloadManager.Request(uris);
request.setNotificationVisibility(Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
Long reference=downloadManager.enqueue(request);
Toast.makeText(this,""+reference,Toast.LENGTH_LONG);
uri= downloadManager.getUriForDownloadedFile(reference);
Log.d("REFERENCE", ""+uri);
}
public void playLocal(View v){
video.setVideoURI(uri);
video.start();
}