安卓获取手机SIM卡状态

  public static int getSimState(Context context){
    TelephonyManager telMgr = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
    int simState = telMgr.getSimState();
        if(simState ==TelephonyManager.SIM_STATE_READY)
        {
           return SIM_OK;
        }
        else if(simState==TelephonyManager.SIM_STATE_ABSENT)
        {
           return SIM_NO;
        }
        else
        {
           return SIM_UNKNOW;
        }
    }

你可能感兴趣的:(安卓获取手机SIM卡状态)