java - List all activated notifications in a ListView -
i can't delete notifications havent' created know but....can list notifications (the text mainly) put them in listview or control ?
thanks
if you're targeting api level 18+, can use notificationslistenerservice
this. note need special bind_notification_listener_service
permission.
<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>
you can use notificationlistenerservice.getactivenotifications()
method current notifications.
if want support on api level 17 or less can use accessibility api read notifications, it's more complicated.
Comments
Post a Comment