0

I'm using C2DM in my application, and I have a receiver, which sends data to a class in the application. The class creates a notification and notifies the notification manager to post it.

The problem is that this does not work when the app is forced close manually through the settings, as this also (apparently) shuts off the broadcast receiver.

What I get though is that when an app is shut off with android 4.0's new task manager (the one thats similar to 3.0 but a user can also swipe an app to the left or right to shut it off) it behaves differently: the broadcast receiver is still working, as I get the intent from the C2DM message, but for some reason my phone still plays the notification noise, whilst no notification appears in the tray.

I can't figure out what's happening, because there is no way for the sound to play without the notification to appear, as the sound is attached to the notification and plays when it's posted, no other way. But no notification appears.

Any insight on why this might be happening would be awesome, or what the new 4.0 task manager actually does to apps when you swipe them off the list.

Thanks.

Raul Rene
  • 10,014
  • 9
  • 53
  • 75
Glenn.nz
  • 2,261
  • 2
  • 17
  • 20
  • I saw today another question on this topic. It seems to resemble somewhat your problem. See http://stackoverflow.com/questions/10513530/android-4-0-c2dm-issue – Raul Rene May 09 '12 at 13:52
  • 1
    Not exactly what i was looking for, but very interesting never the less, ill have to remember that :) – Glenn.nz May 10 '12 at 03:21

1 Answers1

-1

Figured it out, the broadcast receiver was still responding but just failing because it was retrieving things from a class that was part of the main app and was now dead, so now the things it needs are stored in sharedprefs, and retrieved before the notification gets sent.

So to answer the question, no swiping an app from the task manager in 4.0 does not "force kill" the app in the same was as the force kill button in the applications menu in settings. It does kill off the app in such that next time you open it, all the activities restart from scratch, just like if you had been in the last remaining activity and pressed back, hereby calling finish() on the last alive task and shutting down the app. broadcast revivers (and services i assume) still are running afterwards.

Glenn.nz
  • 2,261
  • 2
  • 17
  • 20