Is there any way to get icons of system notifications? I can get a notification parcel with Accessibility service. I can even get the id of the icon from it, but I am stuck there. I have no idea how to use the id to get the actual bitmap so I can display it, because it is not from my apk.
Here is my code so far:
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
Log.d("onAccessibilityEvent");
if (event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) {
if (event.getParcelableData() instanceof Notification) {
Notification notification = (Notification) event.getParcelableData();
Log.d("ticker: " + notification.tickerText);
Log.d("icon: " + notification.icon);
Log.d("largeIcon: " + notification.largeIcon);
}
Log.d("notification: " + event.getText());
}
}
trying to use this id results in
android.content.res.Resources$NotFoundException: Resource ID #0x7f0200ad