Its been a while since I first posted regarding this problem, I've been
away...Mark Murphy was advising me on the problem and I said I would post
the code:
I can see from the Toast in my class that the onReceive method is being
called, but the actual intent that I install in the AlarmManager doesn't
work.
Here is the onReceive code:
public void onReceive(Context context, Intent intent) {
clsWallpaper.wpSettings settings = clsWallpaper.getSettings( context
);
if ( settings.m_intRotation == clsWallpaper.FREQ_MANUAL ) {
// Do nothing rotation is manual!
return;
}
if ( settings != null ) {
AlarmManager am =
(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(context, wprotatorReciever.class);
PendingIntent sender = PendingIntent.getBroadcast(context, 0, i,
0);
long lngInterval = clsWallpaper.getInterval(
settings.m_intRotation, settings.m_lngInterval );
am.setRepeating( AlarmManager.ELAPSED_REALTIME_WAKEUP,
SystemClock.elapsedRealtime(),
lngInterval,
sender);
Toast.makeText(context, "Wall-paper: " +
Long.toString(lngInterval), Toast.LENGTH_SHORT).show();
}
}
The toast near the end does come up after a reboot and the interval I've set
is 5 seconds, so it displays 5000 milliseconds.
Thanks for any help...
Simon
--
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