1
  1. I have tried all of the stack overflow solutions but it didn't work, all solutions are outdated
  2. I tried both below codes but it always return the -1

int slot = intent.getExtras().getInt("slot",-1)

int slot = intent.getExtras().getInt("simId", -1)

  • You need to edit your question with more code ... I am not sure how the calls that you are making should give you the result ... might be a typo in your code I guess – AgentP Apr 24 '22 at 13:28

1 Answers1

1
val accounts = telecomManager.callCapablePhoneAccounts

if (accounts.size > 1) {

                accounts.forEachIndexed { index, account ->
                    if (account == CallManager.call.last()?.details?.accountHandle) {

                        val phoneAccount = telecomManager.getPhoneAccount(account)
                        val label = phoneAccount.label.toString()

                        val img: Drawable =
                            resources.getDrawable(sims[index], theme)
}

Try using this method with telecomManager you can find the sim on which you are receiving call.

Tariq Hussain
  • 409
  • 1
  • 5
  • 19
  • Hi @Tariq Hussain, can u assist me to solve the issue https://stackoverflow.com/q/76097725/5197712 – Anand Apr 25 '23 at 09:19