TelephonyManager.GetServiceStateForSlot(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the service state information on specified SIM slot.
[Android.Runtime.Register("getServiceStateForSlot", "(I)Landroid/telephony/ServiceState;", "GetGetServiceStateForSlot_IHandler", ApiSince=37)]
public virtual Android.Telephony.ServiceState? GetServiceStateForSlot(int slotIndex);
[<Android.Runtime.Register("getServiceStateForSlot", "(I)Landroid/telephony/ServiceState;", "GetGetServiceStateForSlot_IHandler", ApiSince=37)>]
abstract member GetServiceStateForSlot : int -> Android.Telephony.ServiceState
override this.GetServiceStateForSlot : int -> Android.Telephony.ServiceState
Parameters
- slotIndex
- Int32
of phone whose service state is returned
Returns
ServiceState on specified SIM slot.
- Attributes
Remarks
Returns the service state information on specified SIM slot. If you want continuous updates of service state info, register a TelephonyCallback that implements TelephonyCallback.ServiceStateListener through registerTelephonyCallback(int, Executor, TelephonyCallback). May return null when the slotIndex is invalid or when there was an error communicating with the phone process See getActiveModemCount() to get the total number of slots that are active on the device. Requires Manifest.permission.READ_PHONE_STATE and Manifest.permission.ACCESS_COARSE_LOCATION Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS feature which can be detected using PackageManager.hasSystemFeature(String).
Android reference for android.telephony.TelephonyManager.getServiceStateForSlot.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.