Estou fazendo um app que toca uma stream de rádio, e quando começa a tocar, crio uma notificação customizada com 2 botões, um para dar pause/play e outra pra remover a notificação e parar a stream, porém não obtive sucesso e os botões não fazem nada, dei uma lida a respeito de PendingIntent e BroadcastReceiver mas sem sucesso, alguém consegue me ajudar?
Os códigos dos botões:
Intent it = new Intent(MyService.this,MainActivity.class);
it.setAction("tocando");
it.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pi = PendingIntent.getActivity(MyService.this, 0, it, 0);
NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext());
builder.setSmallIcon(R.drawable.ic_launcher);
builder.setContentIntent(pi);
Intent itt = new Intent(getApplicationContext(),MyBroadcast.class);
itt.putExtra("comand", "pause");
PendingIntent pitt = PendingIntent.getBroadcast(getApplicationContext(),23424324, itt, 0);
RemoteViews view = new RemoteViews(getPackageName(), R.layout.notificacao);
view.setOnClickPendingIntent(R.id.pause, pitt);
builder.setContent(view);
Notification not = builder.build();