当前位置: 首页>>代码示例>>Java>>正文


Java Notification.DEFAULT_ALL属性代码示例

本文整理汇总了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);
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:21,代码来源:PushMessagesReceiver.java

示例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);
	}
}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:13,代码来源:NotificationOptions.java

示例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;
}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:14,代码来源:FinancistoService.java

示例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);
	}
}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:8,代码来源:FinancistoService.java


注:本文中的android.app.Notification.DEFAULT_ALL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。