On Thu, Jul 21, 2011 at 4:25 PM, Fred Niggle <[email protected]> wrote:
> however, my goal is to start a service which sets an alarm, and when
> the alarm fires the onStart() event I wish to display another screen
> (e.g. anothermain.xml)

That's a trifle unusual. It would make sense, as a user-chosen option,
if the app is an alarm clock. Generally, services should not be
starting activities, since you don't know what the user is doing at
the time, and the user may not appreciate the interruption.

> In another  of the tutorials I found there is a secction at the foot
> of the service class which defines an interface:
>
> public interface HardButtonListener {
>                void onPrevButtonPress();
>                void onNextButtonPress();
>                void onPlayPauseButtonPress();
>        }
>
> So it seems to me that the service can 'fire' either of the events
> back in the activity, but how do I go about setting this up (the more
> i google the more confused i become)?

The way you would do that is via the binding pattern, which is not
available to you if you are using AlarmManager. Again, if you are
using AlarmManager, you have no idea whether your activity even
exists, let alone is in the foreground.

You may get more help if you explain what it is that you are trying to build.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 3.5 Available!

-- 
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

Reply via email to