Dry
Callbacks for camera shots
/** * equivalent to takepicture (shutter, raw, NULL, JPEG). * @see #takePicture (Shuttercallback, Picturecallback, Picturecallback, Picturecallback) * /publicfinalvoid takepicture (shuttercallback shutter, Picturecallback Raw, picturecallback jpeg) { null, JPEG); }
So, to have the "click" sound when taking pictures, we need to deal with this shuttercallback
Camera.shuttercallback Shuttercallback =NewCamera.shuttercallback () {@Override Public voidOnshutter () {Try{Audiomanager Meng= (Audiomanager) takephotoactivity. This. Getsystemservice (Context.audio_service); intVolume =Meng.getstreamvolume (audiomanager.stream_notification); if(Volume! = 0) { if(Mshootsound = =NULL) {Mshootsound= Mediaplayer.create (takephotoactivity. This, Uri.parse ("File:///system/media/audio/ui/camera_click.ogg")); } if(Mshootsound! =NULL) {Mshootsound.start (); } } } Catch(Exception e) {e.getstacktrace (); } } };I'm the dividing line of the king of the Land Tiger.
Android--Camera.shuttercallback