Make my app launch when secret code entered?

后端 未结 3 1443
我寻月下人不归
我寻月下人不归 2021-02-02 04:34

How would I make my app launch when a secret code, such as *#*#12345#*#* is entered into the dialer?

I couldn\'t find a solution in the Android docs.

3条回答
  •  生来不讨喜
    2021-02-02 04:52

    Insted broadcast reciever maybe you should register to proper activity intent. For example Intent.ACTION_CALL looks promessing. Problem is how to filter intents to recive only this one specyfic number. I suspect that it would look like this (I'm gesing based on what I've found in documentation):

    
        
            
            
            
        
    
    

    Look here and here. Use LogCat to see what exacly intent contatins then you can filter this properly.

提交回复
热议问题