hello guys i am fairly new to widgets and pending intent i am getting a weird behavior while clicking buttons I got 3 buttons on my widget Play /Pause
Next
Previous
the broadcast for Play is working fine but when i click on the next button It is doing what previous button is supposed to do while previous button doesn't do anything at all
I made sure that id's weren't swapped.
here is the code
Intent playIntent = new Intent(BROADCAST_PLAYPAUSE);
PendingIntent playPendingIntent = PendingIntent.getBroadcast(
context, REQUEST_CODE, playIntent, PendingIntent.FLAG_UPDATE_CURRENT);
controlButtons.setOnClickPendingIntent(
R.id.bPlay, playPendingIntent);
Intent nextIntent = new Intent(BROADCAST_SWAP);
nextIntent.putExtra("nextprev", 1);
PendingIntent nextPendingIntent = PendingIntent.getBroadcast(
context, REQUEST_CODE, nextIntent, PendingIntent.FLAG_UPDATE_CURRENT);
controlButtons.setOnClickPendingIntent(
R.id.bNext, nextPendingIntent);
Intent previousIntent = new Intent(BROADCAST_SWAP);
previousIntent.putExtra("nextprev", -1);
PendingIntent previousPendingIntent = PendingIntent.getBroadcast(
context, REQUEST_CODE, previousIntent, PendingIntent.FLAG_UPDATE_CURRENT);
controlButtons.setOnClickPendingIntent(
R.id.bPrevious, previousPendingIntent);
appWidgetManager.updateAppWidget(appWidgetIds, controlButtons);
EDIT :I put the code of next button after the previous button and now nothing works...only play button works..has it something to do with their intents using the same string??and is this an error of the flags of the intent ??
by the way here is how my app looks