Skip to content

Instantly share code, notes, and snippets.

View sharifulislam52's full-sized avatar

Shariful Islam sharifulislam52

View GitHub Profile
Intent intent = new Intent();
PendingIntent my_pIntent = PendingIntent.getActivities(your_activity.this,
0, new Intent[]{intent},0);
Notification mynoti = new Notification.Builder(your_activity.this)
.setTicker("Ticker_Text")
.setContentTitle("Content_Title")
.setContentText("Content_Text")
.setSmallIcon(R.mipmap.ic_launcher)
.setContentIntent(my_pIntent).getNotification();
/**
* Alert 1
* Normal Alert
*/
AlertDialog.Builder alertDialog = new AlertDialog.Builder(your_activity.this); // we build alert
alertDialog.setMessage("Alert_text") // alert text with setMessage() method
.setCancelable(true); // user can cancel this alert for 'true'
AlertDialog alert = alertDialog.create(); // we create alert for show
alert.setTitle("Alert_title");