1
SubscriptionManager manager = SubscriptionManager.from(getApplicationContext());
List<SubscriptionInfo> list = manager.getActiveSubscriptionInfoList();

when I call the above function I get the list of all available sims that are in cell phone. But my question is how to check which sim is the primary one (not in slot one) the one selected for phone calls. I've seen the documentation but found nothing relevant.This can be done using TelephonyManager

TelephonyManager manager = (TelephonyManager) getApplicationContext().getSystemService(getApplicationContext().TELEPHONY_SERVICE);
String carierName = manager.getNetworkOperatorName();

but it only gives the selected sim for phone calls and it only gives one I want both sims name and check which one is active

Ali Zaidi
  • 297
  • 2
  • 14
  • may be this link helps you http://stackoverflow.com/questions/32088950/how-to-check-which-sim-is-set-as-default-sim-in-android-programatically – Developine May 08 '17 at 11:33
  • thanks @HammadTariq but it does not work for me it always returns 0 as defaultSimm and -1 as smsDefaultSim regardless of my selection – Ali Zaidi May 09 '17 at 11:19

0 Answers0