Hi,
Wow that was quick - thanks.
I know this is the intent.
Here is what I did:
---------------------------------------------------------------------------------------------
I have added it to my manifest XML -
<receiver android:name="CallButtonIntentReceiver">
<intent-filter>
<action
android:name="android.intent.action.CALL_BUTTON"/>
</intent-filter>
</receiver>
---------------------------------------------------------------------------------------------
Then created a class called 'CallButtonIntentReceiver' -
public class CallButtonIntentReceiver extends BroadcastReceiver {
private static final String ACTION =
"android.intent.action.CALL_BUTTON";
@Override
public void onReceive(Context context, Intent intent) {
Intent newIntent = new Intent
("android.intent.action.MY_INTENT");
context.startActivity(newIntent);
}
}
---------------------------------------------------------------------------------------------
and in my main activity:
private final BroadcastReceiver mCallButtonIntentReceiver = new
CallButtonIntentReceiver();
private void registerIntentReceivers() {
IntentFilter filter = new IntentFilter
("android.intent.action.CALL_BUTTON");
Intent intnt = registerReceiver(mCallButtonIntentReceiver,
filter);
}
calling 'registerIntentReceivers' from OnCreate.
----------------------------------------------------------------------------------------------
While this compiles and runs - intnt in 'registerIntentReceivers'
above returns null
when run, and nothing happens when I press the GREEN (CALL) button on
my emulator.
Am I doing anything wrong ?
Do I need to ask for any specific permission ?
TIA
Shimon Shnitzer
On Dec 3, 10:25 pm, "Dianne Hackborn" <[EMAIL PROTECTED]> wrote:
> This is the intent launched by the green button:
>
> http://code.google.com/android/reference/android/content/Intent.html#...
>
> On Wed, Dec 3, 2008 at 11:42 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>wrote:
>
>
>
>
>
> > Hi,
>
> > Can you point me to where I can read on how to do this ?
> > (I mean get called when the user pressed the GREEN button).
>
> > TIA
>
> > Shimon
>
> > On Oct 9, 10:22 pm, hackbod <[EMAIL PROTECTED]> wrote:
> > > Just implement the same intent protocols you want to handle. For
> > > pressing the green button, the intent is action
> > > android.intent.action.CALL_BUTTON. For someone dialing a number, it
> > > is android.intent.action.DIAL, etc. These should be defined in the
> > > Intent class.
>
> > > On Oct 9, 11:05 am, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>
> > > > Can you tell me how can you replace the entire app/activity?
>
> > > > Rohit
>
> > > > On Aug 29, 10:17 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > This isn't supported in 1.0. You can only replace the entire
> > > > > Dialtacts activity.
>
> > > > > On Aug 29, 6:44 am, chokoreto <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi,
>
> > > > > > I am trying to replace the default contacts view, but I get a
> > Security
> > > > > > Exception.
>
> > > > > > java.lang.RuntimeException: Unable to start activity
> > > > > > ComponentInfo{com.android.contacts/
> > > > > > com.android.contacts.DialtactsActivity}:
> > > > > > java.lang.SecurityException: Requesting code from
> > > > > > com.swisscom.addrbook.test (with uid 10017) to be run in process
> > > > > > android.process.shared (with uid 10004)
>
> > > > > > I guess, it has something to do that the Contacts Application uses
> > the
> > > > > > TabActivity and each Activity in the tab runs in different
> > processes.
> > > > > > Is there any way how to solve that?
>
> > > > > > I was using this intent-filter
>
> > > > > > <intent-filter >
> > > > > > <action
> > > > > > android:name="com.android.contacts.action.LIST_DEFAULT" />
> > > > > > <category android:name="android.intent.category.DEFAULT"
> > />
> > > > > > </intent-filter>
>
> > > > > > Regards,
> > > > > > Reto
>
> --
> Dianne Hackborn
> Android framework engineer
> [EMAIL PROTECTED]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support. All such questions should be posted on public
> forums, where I and others can see and answer them.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---