Guest User

Untitled

a guest
Dec 18th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. public class OnClearFromRecentService extends Service {
  2.  
  3. @Override
  4. public IBinder onBind(Intent intent) {
  5. return null;
  6. }
  7.  
  8. @Override
  9. public int onStartCommand(Intent intent, int flags, int startId) {
  10. Log.i("ClearFromRecentService", "ClearFromRecentService Service Started");
  11. return START_NOT_STICKY;
  12. }
  13.  
  14. @Override
  15. public void onDestroy() {
  16. super.onDestroy();
  17. Log.i("ClearFromRecentService", "ClearFromRecentService Service Destroyed");
  18. }
  19.  
  20. @Override
  21. public void onTaskRemoved(Intent rootIntent) {
  22. Log.e("ClearFromRecentService", "ClearFromRecentService END");
  23. //Code here
  24. }
  25. }
  26.  
  27. try {
  28. startService(new Intent(PSApplicationClass.this, OnClearFromRecentService.class));
  29. } catch (Exception e) {
  30. Utils.appendLog("Error trying to start OnClearFromRecentService: " + e.getMessage(), "E", Constants.OTHER);
  31. }
  32.  
  33. OTHER Error trying to start OnClearFromRecentService: Not allowed to start service Intent { cmp=nl.hgrams.passenger/.services.OnClearFromRecentService }: app is in background uid UidRecord{9531e38 u10a172 RCVR idle change:uncached procs:1 seq(0,0,0)}
Add Comment
Please, Sign In to add comment