0

i made a sample android app,which starts a started service by calling startService(serviceintent).

it works fine,but if i forceQuit my application from settings>app>downloaded>force_Quit.my service stops and even destroyed is not called. i studied for 3-4 days and know about start_sticky in StartOnCommand method.i am able to achieve all aspects of service.

I want to know whatever i am achieving that service stops and doesnot restart automatically even if started as Start_Sticky is normal behaviour according to android.Can i make it restared if user force quit my application.

my manifest is correct i uses process tag also.

1 Answers1

1

if i forceQuit my application from settings>app>downloaded>force_Quit.my service stops and even destroyed is not called.

Correct.

Can i make it restared if user force quit my application.

No. Nothing of your app will run again until something uses an explicit Intent to start one of your components. Usually, that means that the user taps on your icon in the home screen launcher, though there are other explicit-Intent scenarios (e.g., GCM message).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • thanks commonsware,but dnt get annoyed,can you give any link of Android document,that proofs your saying. – Dharmendra Chaudhary Mar 27 '15 at 11:17
  • @DharmendraChaudhary: The only documentation on this that I know of is the "Launch Controls on Stopped Applications" section of [the Android 3.1 release notes](http://developer.android.com/about/versions/android-3.1.html#launchcontrols). – CommonsWare Mar 27 '15 at 11:21