3

When a phone is ringing ( by an incoming call) If the phone number is a specific number I want to show my custom UI. If It is not, I want to pass it to the (built-in) system call app(Or any other call app is okay).

I should use 'InCallService' and the device set my app as 'a default call app' so that even when the phone screen is locked my custom-UI-activity be shown. The following kotlin source code is my goal.

override fun onCallAdded(call: Call) {  
    //app should receive a new incoming call via 'onCallAdded'

    super.onCallAdded(call)

    val phoneNumber = getPhoneNumber(call)
    if (isMyTargetNumber(phoneNumber)) {
        //show my custom UI
    } else {
        //run a built-in call app
    }
}

The problem that I want to solve is how to run a built-in call app appropriately. I mean I want to complete to wirte the blank of 'else'

    else {
        //run a built-in call app
    }

Apps on the android market like 'truecaller' or 'whosecall' works well the way I want to acheive. I want to make my app such apps. Please help me and advise something to me.

성이름
  • 31
  • 1
  • 3
  • 1
    Hi! I found this question https://stackoverflow.com/questions/57041706/if-my-app-is-selected-as-the-default-dialer-app-is-it-possible-to-make-intent-t – Benoit Guina Apr 20 '20 at 11:18
  • Thank you. But I had read it and the article is not useful to me. OTL – 성이름 Apr 21 '20 at 09:12
  • I want to combine InCalService with built-in UI too. Did you find a solution @성이름? Please share it for me if you did it. Many thanks! – Na Pro May 29 '20 at 04:00

0 Answers0