using a service to terminate an activity

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

using a service to terminate an activity

Postby temo » Sun Apr 20, 2008 8:01 pm

i was wondering if it was possible to terminate an activity using a service.
i figure created the service using startService(...) and the service should terminate the activity that launched it

for example
my steps are
Start main activity>main starts sub>sub starts service

service runs>service decides to kill the activity that started it (so sub and activity are closed)

basically right now if i start a service and then exit the app using the home screen...the onpause()/onfreeze() save the app but i want the service to remove the saved state under certain circumstances...
temo
Freshman
Freshman
 
Posts: 3
Joined: Fri Apr 18, 2008 7:14 pm

Top

about servcie

Postby E.Jyothsna » Wed May 21, 2008 6:37 am

once i started service.After that how can i findout whether service is running or not?Is there any condition for checking service is activated or not?if yes means plz give me reply soon .
E.Jyothsna
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Feb 28, 2008 12:25 pm
Location: chennai

Re: about servcie

Postby borya » Mon Jul 07, 2008 9:33 pm

E.Jyothsna wrote:once i started service.After that how can i findout whether service is running or not?Is there any condition for checking service is activated or not?if yes means plz give me reply soon .


I haven't come up with an elegant way of doing this, but I had my service periodically write to the log or do a Toast.makeText() to see if it was running or not.
borya
Developer
Developer
 
Posts: 27
Joined: Wed Jul 02, 2008 7:50 pm
Location: California, USA

Postby E.Jyothsna » Tue Jul 08, 2008 4:47 am

thank u for giving reply.once let me check
E.Jyothsna
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Feb 28, 2008 12:25 pm
Location: chennai

Top

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests