Internet stopped working on Android Emulator (Mac OS)

后端 未结 9 1521
梦谈多话
梦谈多话 2020-12-08 01:57

I am using Android Studio 2.3(Latest). Till yesterday it was all good and working, today emulator is not connecting to the data network.
I couldn\'t find any solution wo

9条回答
  •  半阙折子戏
    2020-12-08 02:28

    if its an android project, u can change the baseUrl to 10.0.2.2, note this is only applicable from android emulator, will not work on phone

    e.g Api endpoint will now look like this: val baseUri : String = "http://10.0.2.2/restapi/"

    val loginEndpoint = "${baseUri}login"

提交回复
热议问题