How to save Images that are dowloaded WebView in android -


on loading image url in webview want store doesn't store.

this code.

uri uri="http://202.87.34.17/mobiledetect/wallpaper/wallpaper_01.jpg"; widget29=(webview)findviewbyid(r.id.widget29); widget29.loadurl(image);  save();  try{     string path = environment.getexternalstoragedirectory().tostring();     outputstream fout = null;     file file = new file(path, "/sdcard"+image_filename+".jpg");     fout = new fileoutputstream(file);     bitmap mbitmap = null;     mbitmap.compress(bitmap.compressformat.jpeg, 85, fout);     fout.flush();     fout.close();      mediastore.images.media.insertimage(getcontentresolver(),             file.getabsolutepath(), file.getname(),file.getname()); } catch (exception e) {     e.printstacktrace(); } 

i not sure, perhaps need wait until image has downloaded before call save function? i'm not experienced android, dont know if continues instantly or waits until image complete before code continues.

but thats look. perhaps can add "callback" or raise kinda event when "image download done".

does make sense?


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -