The scene I applied to is in the program when the video communication is saved to the local album
/**
Bitmap data obtained from @param bmp
@param picname a custom picture name
*/
Public Static voidsavebmp2gallery (Bitmap bmp, String picname) {string FileName=NULL; //System Album CatalogString gallerypath=environment.getexternalstoragedirectory ()+ File.separator +Environment.directory_dcim+file.separator+"Camera"+File.separator; //declaring file ObjectsFile File =NULL; //declaring the output streamFileOutputStream OutStream =NULL; Try { //If you have a target file, get the file object directly, or create a file with the filename nameFile =NewFile (Gallerypath, picname+". jpg"); //get file relative pathFileName =file.tostring (); //gets the output stream, if there is content in the file, append contentOutStream =NewFileOutputStream (fileName); if(NULL!=OutStream) {bmp.compress (Bmp_format, -, OutStream); } } Catch(Exception e) {e.getstacktrace (); }finally { Try { if(OutStream! =NULL) {outstream.close (); } } Catch(IOException e) {e.printstacktrace (); }
}
// Notify album Updates
MediaStore.Images.Media.insertImage (Mcontext.getcontentresolver (), NULL ); New Intent (intent.action_media_scanner_scan_file); = uri.fromfile (file); Intent.setdata (URI); Mcontext.sendbroadcast (intent); Toastutil.show (" picture saved successfully "); }
Android saves images in the app to the System album and displays