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

Categories

I am using some home replacement that allow me to hide the notification Bar and that's something I really like.

All the informations can be replaced by some widgets, but I would like to display the notifications too.

As I already developed some applications, I would like to know if there is a command line that allow an application to get all the notifications. I plan to add this to a widget or a toast.

Thank a lot for any clue or help.

See Question&Answers more detail:os

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

1 Answer

Since Android API Level 18 (Android 4.3) there is a class NotificationListenerService. You must set the Permission BIND_NOTIFICATION_LISTENER_SERVICE and use a intent-filter with the action NotificationListenerService.

 <service android:name=".NotificationListener"
          android:label="@string/service_name"
          android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
     <intent-filter>
         <action android:name="android.service.notification.NotificationListenerService" />
     </intent-filter>
 </service>

Source: http://developer.android.com/reference/android/service/notification/NotificationListenerService.html#getActiveNotifications()


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...