本文整理汇总了Java中android.app.Notification.DEFAULT_ALL属性的典型用法代码示例。如果您正苦于以下问题:Java Notification.DEFAULT_ALL属性的具体用法?Java Notification.DEFAULT_ALL怎么用?Java Notification.DEFAULT_ALL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.app.Notification
的用法示例。
在下文中一共展示了Notification.DEFAULT_ALL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showNotificationWithUrl
static protected void showNotificationWithUrl(Context context, String title, String notificationText, String url) {
// TODO Auto-generated method stub
NotificationCompat.Builder build = new NotificationCompat.Builder(
context);
build.setSmallIcon(OneSheeldApplication.getNotificationIcon());
build.setContentTitle(title);
build.setContentText(notificationText);
build.setTicker(notificationText);
build.setWhen(System.currentTimeMillis());
Intent notificationIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent intent = PendingIntent.getActivity(context, 0,
notificationIntent, 0);
build.setContentIntent(intent);
Notification notification = build.build();
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.defaults |= Notification.DEFAULT_ALL;
NotificationManager notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(2, notification);
}
示例2: apply
public void apply(Notification notification) {
notification.defaults = 0;
if (isOff()) {
notification.defaults = 0;
} else if (isDefault()) {
notification.defaults = Notification.DEFAULT_ALL;
enableLights(notification);
} else {
applySound(notification);
applyVibration(notification);
applyLed(notification);
}
}
示例3: createRestoredNotification
private Notification createRestoredNotification(int count) {
long when = System.currentTimeMillis();
String text = getString(R.string.scheduled_transactions_have_been_restored, count);
Notification notification = new Notification(R.drawable.notification_icon_transaction, text, when);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.defaults = Notification.DEFAULT_ALL;
Intent notificationIntent = new Intent(this, MassOpActivity.class);
WhereFilter filter = new WhereFilter("");
filter.eq(BlotterFilter.STATUS, TransactionStatus.RS.name());
filter.toIntent(notificationIntent);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
//notification.setLatestEventInfo(this, getString(R.string.scheduled_transactions_restored), text, contentIntent);
return notification;
}
示例4: applyNotificationOptions
private void applyNotificationOptions(Notification notification, String notificationOptions) {
if (notificationOptions == null) {
notification.defaults = Notification.DEFAULT_ALL;
} else {
NotificationOptions options = NotificationOptions.parse(notificationOptions);
options.apply(notification);
}
}