I have implemented an application in which I am downloading an image from a url and storing it on an SD card.
It is showing in the emulator gallery after restarting it. Is it possible to show images in a gallery without restarting emulator?
I have implemented an application in which I am downloading an image from a
Share
Approaches:
#1 If you want immediate results then make use of MediaScannerConnection.
#2 If you don’t need immediate results(eg. you have created new 100s of images) then instead when you are done downloading all the files you could trigger a scan yourself of the entire SD card by telling the system that the card was just mounted:
Conclusion : If you are writing very small no. of files at a time then make use of #1 otherwise #1 is fast when you are dealing with writing very large no. of files which are to be scanned.