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