Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 views
in Technique[技术] by (71.8m points)

java - How to create notification icon badge on Android apps (like iPhone)

I am very new to programming and would like to know what is the best way to go about creating a notification icon badge similar to the ones on the iPhone apps. This would be basically for creating a badge for the notifications that end up in the notification bar.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is actually an answer from Mark Murphy:

For most phones, you use the number field of the Notification object. See here: http://github.com/commonsguy/cw-android/tree/master/Notifications/Notify1/

Now, there are a few phones by one major device manufacturer that have a bug, whereby the number field is ignored. I am working on getting them to fix it. So you can't absolutely rely on that red bubble being there, though it will be on most phones.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...