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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -