• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps wifi/mobile network switching problem

id0001

Well-Known Member
Apr 20, 2010
142
23
Netherlands
I have an application which communictates with a webservice via an URLConnection.

When I start my app, then switch from/to wifi or mobile network. The getInputStream() method throws either a FileNotFoundException on mobile network, or a SocketException on wifi.

Everytime I make a request to the webservice I create a new URLConnection, so it doen't stay open while switching.

Is there a way to solve this?

Thanks in advance,

Id.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones