I am downloading a video from my application but that video is not currently show in gallery, Now i just restart my device and then it shows in gallery item. I don't understand why, Is any video tag set with the file which will tell android to add this item in gallery video.
This is my code
FileOutputStream fos = new FileOutputStream(filePath);
long total = 0;
int len = 0;
byte[] buf = new byte[1024];
while ((len = inputStream.read(buf)) > 0) {
if(!cancel)
{
fos.write(buf, 0, len);
// send update
total = total + len;
}
else
{
File f = new File(filePath);
System.out.println("Path is=========="+f.getAbsolutePath());
if(f.exists())
f.delete();
cancel = false;
break;
}
}
please help, thanks in advance