Sunday, February 20, 2011

[android-developers] Re: Scheduling ideas

Reviving this thread yet again...

There does seem to be some kind of bug in the code. Strange thing is
though, it does get caught. The code always works fine within normal
circumstances, but when it's run as an Alarm Service, the process dies
at a particular line, and it isn't caught in the catch block.

try{
URL updateURL = new URL(sUrl);
conn = updateURL.openConnection();
ins = conn.getInputStream(); // this line causes the process
to die
}catch(IOException ioe){
Log.e(TAG, "Error making URL request " + ioe.getMessage()); //
this is never shown
throw ioe;
}

Any ideas why this would happen?

On Feb 7, 9:41 am, Kostya Vasilyev <kmans...@gmail.com> wrote:

> Having said that, there may be a bug in your code. Since your code,
> AFAIK, schedules one alarm at a time, there may be a situation where the
> old alarm already fired (and forgotten), and the new one isn't
> scheduled. You should schedule the new alarm as soon as you receive the
> old one. Ideally, right inside onReceive for the old alarm's broadcast
> action, because onReceive is guaranteed to not be interrupted.
>
> -- Kostya

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment