How do I disable the Internet connection in Android Emulator?

后端 未结 11 1684
执念已碎
执念已碎 2020-12-29 01:33

I am trying to check Internet connectivity on Android using the following method. I have a Wi-Fi connection.

private boolean checkInternetConnection() {
             


        
11条回答
  •  自闭症患者
    2020-12-29 01:47

    You can actually disable internet connection in the simulator just as you would in a real phone.

    1. Swipe down the screen to see the notification panel.
    2. Tap on the data network icon
    3. Turn off the cellular network.

    I just tried it successfully in an android 4.4 image loaded into my simulator.

提交回复
热议问题