Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in BootReceiver.onReceive - should be getBroadcast not getActivity #12

Open
GoogleCodeExporter opened this issue Apr 8, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

PendingIntent locationListenerPassivePendingIntent = 
PendingIntent.getActivity(context, 0, passiveIntent, 
PendingIntent.FLAG_UPDATE_CURRENT);

should instead read

PendingIntent locationListenerPassivePendingIntent = 
PendingIntent.getBroadcast(context, 0, passiveIntent, 
PendingIntent.FLAG_UPDATE_CURRENT);

as you will discover if you copy this part of the code - the 
PassiveLocationChangedReceiver's onReceive is never called :-)

Original issue reported on code.google.com by ken...@kentonprice.com on 16 Apr 2012 at 4:20

@GoogleCodeExporter
Copy link
Author

You can see the correct code used in PlaceActivity.onCreate:

locationListenerPassivePendingIntent = PendingIntent.getBroadcast(this, 0, 
passiveIntent, PendingIntent.FLAG_UPDATE_CURRENT);

Presumably this is the usual happy-case code path. I just had bad luck by 
harvesting the code from the BootReceiver, which presumably wasn't tested as 
thoroughly ;)

Original comment by ken...@kentonprice.com on 16 Apr 2012 at 4:25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant