HttpURLConnection setConnectTimeout() has no effect

前端 未结 8 1529
刺人心
刺人心 2020-12-04 21:40

I\'m connecting to a simple RSS feed using HTTPUrlConnection. It works perfectly. I\'d like to add a timeout to the connection since I don\'t want my app hanging in the even

8条回答
  •  一向
    一向 (楼主)
    2020-12-04 22:27

    Try to set the ConnectionTimeout before openning the connection.

提交回复
热议问题