Created
May 14, 2014 16:10
-
-
Save scottyab/d5ab6a284622ebc46d5a to your computer and use it in GitHub Desktop.
Creating an explicit pending intent is safer than implicit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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