[android-developers] Re: hooking to the PHONE button

2008-11-06 Thread Declan Shanaghy
Now you're just arguing semantics. I never said he could steal it, that would be quite a stupid thing for the OS to allow. Registering for that Intent allows him to do what he wants in the context of when he is allowed to do it. Therefore it answers his question (or at least gets him as close as

[android-developers] Re: hooking to the PHONE button

2008-11-05 Thread Declan Shanaghy
Well that would imply that the default handling is setup they way i suggested it should be! ;-P @simonsh There's your answer! On Tue, Nov 4, 2008 at 6:09 PM, hackbod [EMAIL PROTECTED] wrote: Oh the -default- handling of the green key is this: private void startCallActivity() {

[android-developers] Re: hooking to the PHONE button

2008-11-05 Thread hackbod
It's not the same, you can't steal it from everyone. This only happens when the currently focused app doesn't do anything special with the phone key. The home key, in contrast, can not be handled by the foreground app -- it always starts the home activity. On Nov 5, 10:09 am, Declan Shanaghy

[android-developers] Re: hooking to the PHONE button

2008-11-04 Thread hackbod
The green phone key is for use by the foreground application. On Nov 3, 7:34 pm, Declan Shanaghy [EMAIL PROTECTED] wrote: It shouldnt be stolen but it should be overridable. Much like the app picker behaves when multiple apps are registered for an Intent. I dont know how the internals of

[android-developers] Re: hooking to the PHONE button

2008-11-04 Thread Declan Shanaghy
It doesn't seem that way. No matter what application I am in if I press the green phone button the recent call log comes up. What about when the user is on the home screen? On Tue, Nov 4, 2008 at 12:22 AM, hackbod [EMAIL PROTECTED] wrote: The green phone key is for use by the foreground

[android-developers] Re: hooking to the PHONE button

2008-11-04 Thread hackbod
Oh the -default- handling of the green key is this: private void startCallActivity() { Intent intent = new Intent(Intent.ACTION_CALL_BUTTON); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getContext().startActivity(intent); } So you can write an activity that

[android-developers] Re: hooking to the PHONE button

2008-11-03 Thread hackbod
Correct, you can't steal it from other apps. When your apps is in the foreground, however, you will see the key as a normal key event that you can process however you want. On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote: I don't think you would be allowed to remap the phone button that would

[android-developers] Re: hooking to the PHONE button

2008-11-03 Thread Declan Shanaghy
It shouldnt be stolen but it should be overridable. Much like the app picker behaves when multiple apps are registered for an Intent. I dont know how the internals of how the off hook button works but couldnt it broadcast an Intent to go off hook which then can be handled like any other intent.