Friday, July 22, 2011

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

Thanks for your reply.

I guess my initial question can therefore be reduced to: How can an
activity know when a service has performed a task?

On 21/07/2011, Mark Murphy <mmurphy@commonsware.com> wrote:
> On Thu, Jul 21, 2011 at 6:33 PM, Fred Niggle <fred.niggle@googlemail.com>
> wrote:
>> What I am writing is a meds reminder app, which has the option of
>> letting a career know if the app is not acknowledged and responded to.
>>
>> The idea is that when the alarm event fires it triggered a sound
>> (alert) to be played (notify user to take meds), and if the alert is
>> not cancelled inside of a given time, then an sms is sent to inform
>> the carer.
>>
>> I have most of the code nicely nailed down, except spawning a screen
>> or alert dialogue which has the Cancel button on it, and it is with
>> this matter that I seek help.
>>
>> As you note in your reply, it is how to Bind the code from the
>> .alarmservice to trigger the alert dialogue or screen in which I am
>> lacking understanding and would hugely appreciate assistance.
>
> You don't "Bind the code from the .alarmservice to trigger the alert
> dialogue or screen". You just start an activity or raise a
> Notification from the service. If you wish to start an activity, use
> startActivity() like you would anywhere else.
>
> --
> 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 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

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