本文整理匯總了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);
}
}