1

I created a notification service which communicate with the local database

When i press Settings Clear Data button while the application is running, the service also stops. but i need to keep the service running while cleaning the database (for testing). does this normally happens.

thanks in advance

Update

I'm using IntentService to create the background service. I'm trying to restart service when this happens. I found out that returning START_STICKY from onStartCommand the service can be restarted. but in IntentService , it says not to overide this method. is there any way to do this thanks again

Chamila Adhikarinayake
  • 3,588
  • 5
  • 25
  • 32
  • It is impossible to clear data while it is being used. The operating system has no way to reach into a running application and clear its data. If you need a way to clear data while the application is running, you have to build it into the application. (If it's not built into the application, how would the operating system do it?) – David Schwartz Jul 23 '12 at 10:39

1 Answers1

0

Replying to ::

I'm using IntentService to create the background service. I'm trying to restart service when this happens. I found out that returning START_STICKY from onStartCommand the service can be restarted. but in IntentService , it says not to overide this method.

They have overridden that method here-

Name is Nilay
  • 2,743
  • 4
  • 35
  • 77