Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent scheduledIntent = new Intent(context,Activity.class);
- PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, scheduledIntent, 0);
- nm = (NotificationManager) context
- .getSystemService(Context.NOTIFICATION_SERVICE);
- CharSequence from = "From address";
- CharSequence message = "New Orders received";
- Notification notif = new Notification(R.drawable.icon,"Hai", System.currentTimeMillis());
- notif.setLatestEventInfo(context, from, message, pendingIntent);
- notif.flags |= Notification.FLAG_AUTO_CANCEL;
- nm.notify(uniqueID, notif);
- notif.ledOnMS = 500;
- notif.ledOffMS = 500;
- AppPreferences prefs = new AppPreferences(PresentChatActivity.this);
- boolean notify_checkbox = prefs.getNotifyState();
- Notification(message.getBody(),fromName, name);
- protected void Notification(String body, String fromName, String Notificationmsg) {
- NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
- String tickerText = getString(R.string.app_name, body);
- Notification notif = new Notification(R.drawable.ic_launcher, tickerText,
- System.currentTimeMillis());
- Intent notificationIntent = new Intent(this, PresentChatActivity.class);
- PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
- notif.setLatestEventInfo(PresentChatActivity.this,Notificationmsg, message, pendingIntent);
- notif.setLatestEventInfo(getApplicationContext(), fromName, body,pendingIntent );
- notificationManager.notify(10001, notif);
- }
Add Comment
Please, Sign In to add comment