Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creating an explicit pending intent is safer than implicit
//explicit (to MyService)
Intent intent = new Intent(context, MyService.class);
PendingIntent pi = PendingIntent.getService(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
//implicit
Intent intent = new Intent("com.my.app.action")
PendingIntent pi = PendingIntent.getService(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment