Change Notification Layout
I decompiled my system music app (from Sony Ericsson for Android GB 2.3.7)
because I want to change the notification layout. I found the method which
creates the notification with this code:
private void sendStatusBarNotification(Track paramTrack)
{
if (paramTrack != null)
{
NotificationManager localNotificationManager =
(NotificationManager)this.mContext.getSystemService("notification");
String str = paramTrack.getArtist();
if ((str == null) ||
(str.equals(this.mContext.getString(2131361954))))
str = this.mContext.getString(2131361798);
Notification localNotification = new Notification(2130837696,
paramTrack.getTitle() + " - " + str, System.currentTimeMillis());
localNotification.flags = (0x2 | localNotification.flags);
localNotification.flags = (0x20 | localNotification.flags);
PendingIntent localPendingIntent =
PendingIntent.getActivity(this.mContext, 0, new
Intent(this.mContext, MusicActivity.class), 268435456);
localNotification.setLatestEventInfo(this.mContext,
paramTrack.getTitle(), str, localPendingIntent);
localNotificationManager.notify(0, localNotification);
}
}
My question now is: How can I change the notification layout? I want to
build a layout which looks like the original android notification layout
but with an extra image on the right of the notification. How can I do
this?
No comments:
Post a Comment