Android Question Call from Dual-Sim

hasexxl1988

Active Member
Licensed User
Longtime User
Hello,
I have the following problem:
I would like to call away from Sim No.2 away. But no matter what I try, the call always goes away from Sim No.1.

I tested it with the Huawei P20 Pro.

I have tried it with the dual sim function of Humberto: https://www.b4x.com/android/forum/threads/b4a-and-dual-sim-phones.12781/#post-278313

as well as with the following code:

B4X:
Dim i As Intent
i.Initialize(i.ACTION_CALL, "tel:" & telNumber.Replace("#", "%23"))
 
i.putExtra("phone_type", 5) 'For sim 2

StartActivity(i)

and this:

B4X:
Dim i As Intent
i.Initialize(i.ACTION_CALL, "tel:" & telNumber.Replace("#", "%23"))
 
i.putExtra("simSlot", 1) 'For sim 2

StartActivity(i)


With:

B4X:
Sub TestSim
   Dim manager As JavaObject
   Dim context As JavaObject
   context.InitializeContext
   manager = manager.InitializeStatic("android.telephony.SubscriptionManager").RunMethod("from", Array(context))
   Dim infos As List = manager.RunMethod("getActiveSubscriptionInfoList", Null)
   For Each info As JavaObject In infos
        Log(info)
    Log(info.RunMethod("getDisplayName", Null))
    Log(info.RunMethod("getNumber", Null))
   Next
End Sub

Its the LOG:

B4X:
Logger verbunden mit:  HUAWEI CLT-L29
--------- beginning of system
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
(SubscriptionInfo) {id=0, iccId=894301561XXXXXXXXXXX simSlotIndex=0 displayName=CARD 1 carrierName=A1 nameSource=0 iconTint=-16746133 dataRoaming=1 iconBitmap=android.graphics.Bitmap@26bc14d mcc 232 mnc 1 isEmbedded false accessRules null mnc 1 mSubStatus=1 mNwMode=-1}
CARD 1
null
(SubscriptionInfo) {id=1, iccId=894301561XXXXXXXXXXX simSlotIndex=1 displayName=CARD 2 carrierName=A1 nameSource=0 iconTint=-13408298 dataRoaming=1 iconBitmap=android.graphics.Bitmap@b54f402 mcc 232 mnc 1 isEmbedded false accessRules null mnc 1 mSubStatus=1 mNwMode=-1}
CARD 2
null

i can Read the SimID, but do not put.

Does anyone have a tip?
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top