views:

89

answers:

1

I have a program that has a broadcast receiver that listens for Phone_State and then sends a user defined intent. Well, my problem is that the system also sends out an intent (the one that I am trying to replace with my program) So I am trying to find a way to CANCEL the systems intent. I have found that if i have a timer just wait for a little bit, then I can send mine after the systems, but that is not very good, and sometimes defeats the purpose of my program. Also, i cannot set my program as a default because it is not a full dialer program. Just one action of it. Someone please help me find how to listen for and cancel a system intent/activity....

A: 

Someone please help me find how to listen for and cancel a system intent/activity

You cannot "cancel" an activity, period.

You cannot replace the dialer.

If the system Intent was sent via sendOrderedBroadcast(), then you can call abortBroadcast() from your BroadcastReceiver, and any lower-priority receivers will not get the broadcast. However, I have no evidence that ACTION_PHONE_STATE_CHANGED is an ordered broadcast, and I sincerely hope it isn't.

Whatever you are trying to do probably should be accomplished via modifications to your own custom firmware.

CommonsWare
So, you are saying that I cant just somehow overshadow the system intent, without just waiting for the system intent to go and then calling mine? And unfortunately I dont know how to listen for a specific activity... Is there a way to listen to activity manager for a specific activity?
roger l