@Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); Log.d(TAG, ">> mBroadcastReceiver action received = " + action); mHandler.removeMessages(Constants.HANDLER_MESSAGE_PLAY_RADIO_CHANNEL_TIMEOUT); // send handler message switch (action) { case MusicService.ACTION_PLAYED: case MusicService.ACTION_PAUSED: case MusicService.ACTION_COMPLETED: case MusicService.ACTION_ERROR: case MusicService.ACTION_STOPPED: case MusicService.ACTION_PLAYING_STATUS: Message msg = new Message(); msg.what = HANDLER_MESSAGE_MUSIC_SERVICE_ACTION; Bundle b = new Bundle(); b.putString(MusicService.EXTRA_ACTION, action); b.putSerializable( MusicService.EXTRA_PLAYING_STATUS, intent.getSerializableExtra(MusicService.EXTRA_PLAYING_STATUS)); b.putParcelable( MusicService.EXTRA_MUSIC_ITEM, intent.getParcelableExtra(MusicService.EXTRA_MUSIC_ITEM)); msg.setData(b); mHandler.sendMessage(msg); break; default: break; } }