Wednesday , June 29 2022

Direct Reply Notification in Android like WhatsApp Tutorial – Android Coding by DMTechnolab

public Zero Display()) {{

// Pending intent for notification button named moring

Pending morePendingIntent = Pending.getBroadcast()

Main activity.this,


New Intent()Main activity.this, Notification.class)




// a notification button intended for help pending

Pending helpPendingIntent = Pending.getBroadcast()

Main activity.this,


New Intent()Main activity.this, Notification.class)




// We need this object to get input directly from notification

Remoteinput Remoteinput = New Remoteinput.Builder()NOTIFICATION_REPLY)

.Settabel()“Enter your name”)


// We need this action object for remote input

Notification.The verb The action =

New Notification.The verb.Builder()Android.R.Attractible.ic_delete,

“reply now…”, helpPendingIntent)



// Create a notification builder object

Notification.Builder mBuilder = New Notification.Builder()this, CHANNNEL_ID)


.setContentTitle()“Hey this is simplified coding …”)

.setContentText()“Please share your name with us”)



.AddAction()The action)

.AddAction()Android.R.Attractible.ic_menu_compass, “Excess”, morePendingIntent)

.AddAction()Android.R.Attractible.ic_menu_directions, “Help”, helpPendingIntent);

// Finally display the notification

Notification manager informer = ()Notification manager) getSystemService()NOTIFICATION_SERVICE);

informer.please inform()NOTIFICATION_ID, mBuilder.Construction()));


Source link

About dmtechnolab

Check Also

Simplified Coding

Android Hilt Tutorial – Injecting Dependencies with Hilt – Android Coding by DMTechnolab

You are welcome Android Hilt tutorial. I hope you all are aware of it Dependency …

Leave a Reply

Your email address will not be published. Required fields are marked *