Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //call notifiacation
- NotificationManagerCompat.from(MainActivity.this).notify(NotificationManager.NOTIFY_ID, new NotificationManager().getBuilder(this,"Hyieohered").build());
- //NOTIFICATION MANAGER
- public class NotificationManager {
- public static final int NOTIFY_ID= 187;
- public NotificationCompat.Builder getBuilder(Context c, String qName) {
- Intent intent = new Intent(c, AddInQ.class);
- Intent yesI = new Intent(c, AgreeWithQ.class);
- Intent noI = new Intent(c, DisagreeWithQ.class);
- PendingIntent cIntent = PendingIntent.getActivity(c,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
- PendingIntent yesActivity = PendingIntent.getActivity(c, 0, yesI, PendingIntent.FLAG_CANCEL_CURRENT);
- PendingIntent noActivity = PendingIntent.getActivity(c, 0, noI, PendingIntent.FLAG_CANCEL_CURRENT);
- return new NotificationCompat.Builder(c,"simple channel").setSmallIcon(R.drawable.ic_check_q)
- .setContentTitle("Add in querry").setContentText("R u wanna add in "+qName)
- .setPriority(NotificationCompat.PRIORITY_DEFAULT).setContentIntent(cIntent)
- .addAction(R.drawable.ic_yes,"yes",yesActivity)
- .addAction(R.drawable.ic_no,"no",noActivity)
- .setAutoCancel(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement