How to read content and sender name from notification bar?

Hello all, I am making the application which can read the information such as sender name/id, content from the notification bar. From notification, I can read the package information : kakao package. However, I do not know how can read more information such as sender name/id, content from the notification bar. I am using Android 5.0. Could you help me please?

What about the NotificationManager?

As far as I know,

the usual way to make a notification bar is to use NotificationCompat.Builder like below

    NotificationCompat.Builder builder= new NotificationCompat.Builder(this);   
    builder.setSmallIcon(android.R.drawable.ic_dialog_email);
    builder.setTicker("Notification"); // text shown shortly when it appears.
    builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), android.R.drawable.ic_input_add)); // set Icon when status bar is extended.
    builder.setContentTitle("Contents Title");
    builder.setContentText("Contents TEXT");

I’m not sure but NotificationCompat.Builder might have content GETTER as well as content setter.

But I don’t understand about the sender you mentioned.

Sorry.

1개의 좋아요

Thanks. I found the solution. It is very easy. Just calls the function to get text from NOtification. In the notification, it included the sender and message.

2개의 좋아요