You can define an Application subclass in your AndroidManifest.xml.
Your other components can access the application from
Context.getApplication(). You could have your MainActivity register
itself with your Application class when it is active and unregister
when it is stopped/paused.


On Jun 25, 10:24 am, Tina <[email protected]> wrote:
> Hi all,
> I have small simple Service and big MainActivity with UI.
> Service is called periodically from AlarmManager.
>
> My Service need to know  if MainActivity is on the screen and inform
> MainActivity about state changing.
>
> How can I do it?
>
> Thanks for any infornation,
> Tina

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