Hello,
I've developped a widget and some users report it's not updating and
put a one-star comment in the Market!
I'm using both the updatePeriodMillis in the Xml and a service (using
AlarmManager and registered events) to ensure Widget gets updated.
I also tests on 2 devices (one HTC and one APAD). On the APAD I never
receive the onUpdate() except the first!?
Within the service I store all widget information to be able to
recover in case process is killed (by app killer or android)
During widget update I check service is running and restart it if
needed.
Now I've read the process lifecycles and noted that Android may kill
my service or even my process if memory is low!
If both are killed, there is no chance the widget will ever get
updated again!
If service is killed then next update will be based on
updatePeriodMillis if ever, user will still complain!
If process is killed, no more updatePeriodMillis, but updates are
ok...
Is there a way to recover from these scenarios? How can I retrieve the
widget ids, managers and context if I manage to start a new process?
Why my service if killed is not restarted on the next Alarm or
registered events trigger???
I start the alarm with this:
Intent intent = new Intent(context,
bmw_scheduler.class);
pending_intent = PendingIntent.getBroadcast(ctx, 0,
intent, 0);
schedule_manager =
(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
I assumed that even if I end the process this alarm will instantiate a
new bmw_scheduler class and launch it???
But it doesn't seem to happen...
Any help will be much appreciated!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en