나는 많은 게시물을 읽고 많은 솔루션을 시도했지만 모든 게시물의 공통점은 모두 구식이며 적어도 최신 버전의 Android에서 작동하는 솔루션을 찾을 수 없다는 것입니다.
Post 1 , 결과 :
intent.getExtras().getInt("simId", -1)항상 -1을 반환
Post 2 , 결과 : intent.getExtras().getInt("slot", -1)항상 -1을 반환
게시물 3 , 결과 :
String[] array = new String[]{
"extra_asus_dial_use_dualsim",
"com.android.phone.extra.slot",
"slot",
"simslot",
"sim_slot",
"subscription",
"Subscription",
"phone",
"com.android.phone.DialingMode",
"simSlot",
"slot_id",
"simId",
"simnum",
"phone_type",
"slotId",
"slotIdx"
};
for (String item :
array) {
Log.i(TAG, "Sim Card - " + item + " -----> " + intent.getExtras().getInt(item));
}
로그 :
PhoneCallReceiver: Sim Card - extra_asus_dial_use_dualsim -----> 0
PhoneCallReceiver: Sim Card - com.android.phone.extra.slot -----> 0
PhoneCallReceiver: Sim Card - slot -----> 0
PhoneCallReceiver: Sim Card - simslot -----> 0
PhoneCallReceiver: Sim Card - sim_slot -----> 0
PhoneCallReceiver: Sim Card - subscription -----> 0
PhoneCallReceiver: Sim Card - Subscription -----> 0
PhoneCallReceiver: Sim Card - phone -----> 0
PhoneCallReceiver: Sim Card - com.android.phone.DialingMode -----> 0
PhoneCallReceiver: Sim Card - simSlot -----> 0
PhoneCallReceiver: Sim Card - slot_id -----> 0
PhoneCallReceiver: Sim Card - simId -----> 0
PhoneCallReceiver: Sim Card - simnum -----> 0
PhoneCallReceiver: Sim Card - phone_type -----> 0
PhoneCallReceiver: Sim Card - slotId -----> 0
PhoneCallReceiver: Sim Card - slotIdx -----> 0
첫 번째 SimCard와 두 번째 SimCard에 대해 동일한 값 0을 가진 동일한 로그를 표시합니다.
나는 다른 비슷한 게시물을 시도했습니다. 새로운 버전의 Android에서는 작동하지 않았습니다!
최신 버전의 Android (7.0 이상)에서 작동하는 다른 솔루션이 있습니까?
"item"이 맥락에서 거의 확실하지 않습니다. 내가 말했듯이, 당신이 기대하는 것보다 가지고있는 것을 인쇄 해보십시오. 이 전체 솔루션은 약간의 해킹처럼 보이지만 사용 가능한 키는 일부 장치에서 여전히 작동하지 않을 수 있습니다.
intent.getExtras().getInt("item")<-item보다 사용 하지"item"않습니까?