What do you mean by the service is still running in the background? What is the return value of your call to stopService() ? How are you determining that it is still running afterwards?
On Thu, Aug 6, 2009 at 5:30 AM, Archana <[email protected]> wrote: > > Hi , > > How can we stop Service.I tried put it in both onstop and ondestroy() > method.While exiting It is calling this method but service still > running background.Whether i am doing anything wrong? > > private static Intent serviceIntent ; > > protected void onCreate() { > serviceIntent = new Intent(this, LocalService.class); > startService(serviceIntent); > } > @Override > protected void onStop() { > // TODO Auto-generated method stub > super.onStop(); > Log.e("CallingOnStop", "OnStop"); > stopService(serviceIntent); > } > > @Override > protected void onDestroy() { > // TODO Auto-generated method stub > super.onDestroy(); > Log.e("CallingOnDEstroy", "OnDestroy"); > stopService(serviceIntent); > } > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

