So I have this code and it works fine in my notifications. But the correct song does not display.
My ("Standard Title") and ("songTitle") test works fine with the dummy data. But the actual song data does not display like ("Metallica") or ("Master Of Puppets"). I have files in my raw folder and the songs play fine but when the app runs, the correct (name of the band) and the (song title)do not show.
My question is; should I create and xml file that will hold that information? or Perhaps a set of Strings in the values folder?
I appreciate your help.
// Notification Manager
NotificationManager mgr =
(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
// Setting the default action.
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
Intent intent = new Intent(this, MainActivity.class);
PendingIntent pIntent =
PendingIntent.getActivity(this, REQUEST_NOTIFY_LAUNCH, intent, 0);
// Setting the default action.
builder.setContentIntent(pIntent);
builder.setSmallIcon(R.drawable.ic_launcher);
builder.setLargeIcon(BitmapFactory.decodeResource(
getResources(), R.drawable.ic_launcher));
builder.setContentTitle("Standard Title");
builder.setContentText("songTitle");
mgr.notify(STANDARD_NOTIFICATION, builder.build());
}
0 comments:
Post a Comment