My app listening notification data from extends NotificationListenerService. I would like to get the call duration of a Whatsapp call
I tried with Notification.EXTRA_SUB_TEXT and Notification.EXTRA_CHRONOMETER_COUNT_DOWN but nothing work.
public static String getSubText(Notification notification) {
Bundle extras = NotificationCompat.getExtras(notification);
String text;
CharSequence charSequence = extras.getCharSequence(Notification.EXTRA_SUB_TEXT);
if (charSequence != null) {
text = charSequence.toString();
} else {
text = String.valueOf(extras.get(Notification.EXTRA_SUB_TEXT));
}
return text;
}
