How to start an Activity from a dialed phone code (e.g. #120)

364 Views Asked by At

I am trying to launch my app from a dialed code (say #120) on the phone dialer. I believe I've seen some apps that do this already. So to launch the app, the user would go to the phone and try to make a call to #120, which would open my activity instead of making a phone call to #120. Anyone with ideas on how this can be accomplished?

1

There are 1 best solutions below

4
On

By registering an intent in the chain of responsibility for the dialer-action. The chain of responsibility is ran down from first to last entry, and each registered observer may choose to either handle the entry or pass it down to the next entry in the chain. That way, you could handle the code with one application and let the other applications handle the phonecall.