Android java.net.UnknownHostException: Host is unresolved

前端 未结 17 1060
被撕碎了的回忆
被撕碎了的回忆 2020-12-01 08:43

This code doesn\'t work:

URL         url   = new URL( xmlPath );
InputSource input = new InputSource( url.openStream() );

all the time, res

17条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 09:23

    You need to enable internet in your emulator.

    • Open emulator

    • Press menu button and open "settings"

    • Open "wireles and network"

    • Open "Mobile Networks"

    • Check on "Data enable"

    Now test your application again.

提交回复
热议问题