[android-developers] Re: Get current activity from Service

2009-05-14 Thread Mark Murphy
> But how do i post a message to the service from my activity. Option #1: If it is a local service, make the service be a singleton (i.e., in onCreate(), make "this" be available from a public static data member or method), and have the activity call methods on the singleton. Option #2: If this

[android-developers] Re: Get current activity from Service

2009-05-14 Thread Manjunatha M
But how do i post a message to the service from my activity.. On Fri, May 15, 2009 at 10:28 AM, Mark Murphy wrote: > > > I have written a service, which observes couple of databases. Now that > > I don't want to handle this when a particular activity is running. Its > > my own activity. How do i

[android-developers] Re: Get current activity from Service

2009-05-14 Thread Mark Murphy
> I have written a service, which observes couple of databases. Now that > I don't want to handle this when a particular activity is running. Its > my own activity. How do i do that??? Have your activity tell your service "I'm alive!" in onResume(), and have your activity tell your service "I'm o

[android-developers] Re: Get current activity from Service

2009-04-08 Thread Dianne Hackborn
No, unless you implement code in the activity to watch this yourself. On Wed, Apr 8, 2009 at 11:52 PM, a...@lg wrote: > > Is it possible to get the currently running activity through > Service..?? > > i.e. I have a service started by an Activity A, and now I want to stop > the service by another