开发者

Access the android notifications of other applications

开发者 https://www.devze.com 2023-03-12 20:03 出处:网络
Is it possible to programatically access the text posted on the android notification area (displayed by an application which is not my own)?

Is it possible to programatically access the text posted on the android notification area (displayed by an application which is not my own)?

The logic I am after would be something like...

for each (NotificationMes开发者_运维技巧sage m in NotificationArea.Notifications)
{
  String msg = m.GetMessage()
} 


Unfortunately, no. This would create security concerns, possibly hijacking personal information. See This Thread


In Android 4.3 and above, use the NotificationListenerService. Otherwise use Accessibility.

http://developer.android.com/reference/android/service/notification/NotificationListenerService.html


This is possible with the accessibility service, but you have to pick up on notifications as they arrive (ie there isn't a list you can iterate around at any point). You'd need to build that up yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消