简体   繁体   中英

apk crashes in background when no internet connection

I had developed a small application which is running fine while having internet connection. But crashes when lost internet connection. I had implemented

  1. Asynctask to fetch information from server and to display
  2. Service which continuously monitor for the new message and gives notification if it found a new one. It run for every minute.
  3. Declared min-sdk and target-sdk to 8 in the Manifest file.

Can anyone help me out of this ?? I am not getting an issue weather its an AsyncTask or API level.

use try and catch to handle the exception like this:

try
{
    MyService.CallFunction();
}
catch(Exception ex)
{
    //Show an error Message
}

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