Thursday, July 21, 2011

[android-developers] How to get a service to either return a string or start a function in main activity?

Hello,

Thanks for taking the time to read this.

I've been on this for some time and have only recently mastered
service... or so I thought.

I found a tutorial about services at
http://marakana.com/forums/android/examples/60.html and
http://android-er.blogspot.com/2010/10/simple-example-of-alarm-service-using.html

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)

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

Thanks for any help you can provide,
Fred

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