Skip to content

Instantly share code, notes, and snippets.

@kaka2507
Created July 21, 2016 08:19
Show Gist options
  • Save kaka2507/cbbc9ca2650269640788755bd7da05f1 to your computer and use it in GitHub Desktop.
Save kaka2507/cbbc9ca2650269640788755bd7da05f1 to your computer and use it in GitHub Desktop.
if (Build.VERSION.SDK_INT >= 16 && !TextUtils.isEmpty(info.url)) {
NotificationImageTask nit = new NotificationImageTask(new MyNotification(this.mNotificationManager, builder, info));
nit.execute(info.url);
} else {
builder.setContentTitle(info.title).setContentText(info.text);
Notification notification = builder.build();
if (notification != null) {
if (Shared.getInstance().getBoolean("PREF_NOTIFICATION_SOUND", true))
notification.defaults |= Notification.DEFAULT_SOUND;
if (Shared.getInstance().getBoolean("PREF_NOTIFICATION_VIBRA", true))
notification.defaults |= Notification.DEFAULT_VIBRATE;
if (Shared.getInstance().getBoolean("PREF_NOTIFICATION_LED", true))
notification.defaults |= Notification.DEFAULT_LIGHTS;
this.mNotificationManager.notify(info.id, notification);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment