Hi
Samsung Galaxy, Android 1.5. I'm trying to detect when the user
releases the camera button. I have a receiver that gets the
ACTION_CAMERA_BUTTON intent and examines the EXTRA_KEY_EVENT that
comes with it,using the following code (in the onReceive() in the
receiver)
@Override
public void onReceive(Context context, Intent intent) {
String intent_action = intent.getAction();
if (intent_action.equals(Intent.ACTION_CAMERA_BUTTON) ) {
abortBroadcast();
KeyEvent key = (KeyEvent) intent.getParcelableExtra
(Intent.EXTRA_KEY_EVENT);
if ( key.getAction() == KeyEvent.ACTION_DOWN )
Toast.makeText(context, "press",
Toast.LENGTH_SHORT).show();
else if ( key.getAction() == KeyEvent.ACTION_UP )
Toast.makeText(context, "release",
Toast.LENGTH_SHORT).show();
else if ( key.getAction() == KeyEvent.ACTION_MULTIPLE )
Toast.makeText(context, "multi",
Toast.LENGTH_SHORT).show();
}
}
When I press the button, I only get the "press" popup.
Is this a limitation in the phone or in Android? Is there another way
to detect the release of the camera key?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en