Multiple notification icons on one bar?

Go To StackoverFlow.com

0

Is it possible to create a notification bar that contains multiple icons horizontally and each icon launches a separate service/activity?

2012-04-03 21:47
by JonPM
Are you talking about replacing the stock notification bar in Android, or is it a custom notification bar inside your own application you want to make - TommyN 2012-04-03 21:52
Sorry, I mean the pull down notification area - JonPM 2012-04-03 21:54


1

No, a notification only has a single PendingIntent (as seen in this API method). You could conceivably create a custom notification layout with multiple icons, but you could only launch one activity.

Update:

Actually if you read that doc carefully, it looks like as of API 11, you can do what you're trying to accomplish by setting RemoteViews.setOnClickPendingEvent on your views in your custom layout!

2012-04-03 22:04
by kabuko
I see. Would it be possible to pass a variable to the one activity, but the variable changes depending on which icon is clicked - JonPM 2012-04-03 22:17
Apparently it's changed in API 11, updated answer to reflect that - kabuko 2012-04-03 22:22
Ads