Bala
Bala

Reputation: 31

Android application unknown host exception

I developed an application for android tablets. In that application, when I get into the app and after doing some actions I keep the application idle for half an hour or sometimes and again get back into the app to perform any action, it leads to application crash with UNKNOWNHOSTEXCEPTION.I don't know why it happens even after i gave INTERNET permission in Android manifest file.I have been searching solution for this problem for one week...still i could not able to find any solution.i used fragments in my application...please help me...

Upvotes: 0

Views: 190

Answers (2)

Rajeev N B
Rajeev N B

Reputation: 1363

This type of exception happens when you try to switch networks , or the required Network isn't available.

Use try/catch block to prevent crashing of application.

Upvotes: 0

Dimanoid
Dimanoid

Reputation: 7289

Likely the tablet temporary switching off the network to save energy. Add try/catch to your requests and probably do 2-3 tries in some interval before you will show error to user.

Upvotes: 1

Related Questions