Preload the media button receiver
It has a somewhat noticable initialization delay
This commit is contained in:
parent
368e04c7ad
commit
998b82a469
@ -696,6 +696,10 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
|
||||
mHandler.sendEmptyMessageDelayed(SAVE_STATE, 5000);
|
||||
break;
|
||||
case POST_CREATE:
|
||||
// Preload the receiver so we don't have an intial delay as it
|
||||
// loads for the first button press
|
||||
sendBroadcast(new Intent(Intent.ACTION_MEDIA_BUTTON));
|
||||
|
||||
mReceiver = new Receiver();
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(Intent.ACTION_HEADSET_PLUG);
|
||||
|
Loading…
x
Reference in New Issue
Block a user