Android: Unregister camera button

Posted by niko on Stack Overflow See other posts from Stack Overflow or by niko
Published on 2009-06-12T13:18:59Z Indexed on 2010/03/29 16:33 UTC
Read the original article Hit count: 436

Filed under:
|

Hi,

I tried to bind some actions to a camera button:

videoPreview.setOnKeyListener(new OnKeyListener(){
		public boolean onKey(View v, int keyCode, KeyEvent event){
			if(event.getAction() == KeyEvent.ACTION_DOWN)
			{
				switch(keyCode)
				{
				case KeyEvent.KEYCODE_CAMERA:
					//videoPreview.onCapture(settings);
					onCaptureButton();

...
				}
			}
			return false;
		}
	});

Pressing the button however the application crashes because the original Camera application starts.

Does anyone know how to prevent Camera application start when the camera button is pressed?

© Stack Overflow or respective owner

Related posts about android

Related posts about camera