简体   繁体   中英

Can a button be clicked in status bar notification before ICS?

While it is easy to put buttons into status bar notification (and get it working) in ICS, the displayed buttons seem unable to get focus or click in earlier versions of android. Is this the case? The focus will get delivered to the whole notification, not the buttons in front of it (I used the RemoteViews.setOnClickPendingIntent(int, PendingIntent) to link the buttons).

No, you can't have UI elements like this in pre Honeycomb. All you can have is pending intent once your notification entry is tapped as whole and that's it. if you need, you may show user a chooser (ie activity themed as dialog) so user could pick up anything extra needed, but you can't have it directly in notification area

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM