How to check if mobile network is enabled/disabled

前端 未结 5 1951
别跟我提以往
别跟我提以往 2020-12-09 23:31

I would like to know if the mobile network is enabled or disabled.

My application is designed to help the user when he receives a phone call, and to do this I need I

5条回答
  •  不思量自难忘°
    2020-12-09 23:48

        PackageManager pm = context.getPackageManager();
        boolean hasTelephony = pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
    

提交回复
热议问题