properly update ComponentName package

This commit is contained in:
Domingos Lopes 2016-04-09 12:19:56 -04:00
parent 378c47f8eb
commit 4ea7448f18
1 changed files with 2 additions and 1 deletions

View File

@ -250,7 +250,8 @@ public class PlaybackService extends Service implements SharedPreferences.OnShar
taskManager = new PlaybackServiceTaskManager(this, taskManagerCallback);
mediaPlayer = new PlaybackServiceMediaPlayer(this, mediaPlayerCallback);
ComponentName eventReceiver = new ComponentName(getPackageName(), MediaButtonReceiver.class.getName());
ComponentName eventReceiver = new ComponentName(MediaButtonReceiver.class.getPackage().getName(),
MediaButtonReceiver.class.getName());
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(eventReceiver);
PendingIntent buttonReceiverIntent = PendingIntent.getBroadcast(this, 0, mediaButtonIntent, PendingIntent.FLAG_UPDATE_CURRENT);