简体   繁体   中英

How can I fix exception in my Android project?

I have application which runs in background. I have some problem - my application need Internet, because it monitors web-site for data, and if application runs and Internet will interrupt - application throw Error message on screen and stops. How can I fix that? I want that application absorbed error while Internet is absent, and when Internet will work my app continue it's work.

For the design of your Project

  1. Please ensure for the internet connection before making HTTP call so it will not execute the HTTP call and hence prevention of unwanted call.

  2. and you can put the try catch block surrounding the HTTP call and if it is throwing the exception you can show dialog to user for the something bad happen!!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM