當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。