0

I have a SyncAdapter extending AbstractThreadedSyncAdapter . I want to clear cache (no problem) and kill the app in onPerformSync(), what would be the best way to kill the app in onPerformSync() ? Thanks.

hixhix
  • 771
  • 7
  • 23

1 Answers1

0

You would want to finish all Activities gracefully, and do this by calling finish() for all activities that haven't been destroyed already.

I answered a question earlier today similar to this in order to finish all activities still not ended in a user's application:

OnBackPressed after implementation taking me back to a previous activity

Let me know if you have any questions.

Community
  • 1
  • 1
Lucas Crawford
  • 3,078
  • 2
  • 14
  • 25
  • In onPerformSync(), is there a way to find all active activities of the current app? I only have application text and not sure how to find all active activities from it. Thanks. – hixhix Sep 04 '15 at 00:04