user3250732
user3250732

Reputation: 61

Call a webservice when android service is destroyed


there is a function, or is it possible to know if a service, in android, it was destroyed by a user and call a webservice when that happens.
for example: the user sent to background a aplication and destroyed, when we destroy a app, the app calls a webservice.
sorry for my english.

Upvotes: 0

Views: 437

Answers (1)

Pedantic
Pedantic

Reputation: 5022

You can invoke a webservice call in your activity's onPause(), I wouldn't use onDestroy() since its not guaranteed to be called.

API reference is here.

Upvotes: 1

Related Questions