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


Java Notification.DEFAULT_LIGHTS属性代码示例

本文整理汇总了Java中android.app.Notification.DEFAULT_LIGHTS属性的典型用法代码示例。如果您正苦于以下问题:Java Notification.DEFAULT_LIGHTS属性的具体用法?Java Notification.DEFAULT_LIGHTS怎么用?Java Notification.DEFAULT_LIGHTS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.app.Notification的用法示例。


在下文中一共展示了Notification.DEFAULT_LIGHTS属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addCustomNotification

public void addCustomNotification(Intent onClickIntent, int iconResourceID, String title, String message, boolean isOngoingEvent) {
	PendingIntent notifContentIntent = PendingIntent.getActivity(this, 0, onClickIntent, PendingIntent.FLAG_UPDATE_CURRENT);
	
	Bitmap bm = null;
	try {
		bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
	} catch (Exception e) {
	}
	mCustomNotif = Compatibility.createNotification(this, title, message, iconResourceID, 0, bm, notifContentIntent, isOngoingEvent,notifcationsPriority);
	
	mCustomNotif.defaults |= Notification.DEFAULT_VIBRATE;
	mCustomNotif.defaults |= Notification.DEFAULT_SOUND;
	mCustomNotif.defaults |= Notification.DEFAULT_LIGHTS;
	
	notifyWrapper(CUSTOM_NOTIF_ID, mCustomNotif);
}
 
开发者ID:treasure-lau,项目名称:Linphone4Android,代码行数:16,代码来源:LinphoneService.java

示例2: makeNotification

private Notification makeNotification(PendingIntent pendingIntent, String title, String content, String tickerText,
                                      int iconId, boolean ring, boolean vibrate) {
    NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
    builder.setContentTitle(title)
            .setContentText(content)
            .setAutoCancel(true)
            .setContentIntent(pendingIntent)
            .setTicker(tickerText)
            .setSmallIcon(iconId);
    int defaults = Notification.DEFAULT_LIGHTS;
    if (vibrate) {
        defaults |= Notification.DEFAULT_VIBRATE;
    }
    if (ring) {
        defaults |= Notification.DEFAULT_SOUND;
    }
    builder.setDefaults(defaults);

    return builder.build();
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:20,代码来源:AVChatNotification.java

示例3: makeNotification

private Notification makeNotification(PendingIntent pendingIntent, String title, String content, String tickerText,
                                      int iconId, boolean ring, boolean vibrate) {
    NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
    builder.setContentTitle(title)
            .setContentText(content)
            .setTicker(content)
            .setAutoCancel(true)
            .setContentIntent(pendingIntent)
            .setTicker(tickerText)
            .setLargeIcon(largeIconId())
            .setSmallIcon(iconId);
    int defaults = Notification.DEFAULT_LIGHTS;
    if (vibrate) {
        defaults |= Notification.DEFAULT_VIBRATE;
    }
    if (ring) {
        defaults |= Notification.DEFAULT_SOUND;
    }
    builder.setDefaults(defaults);

    return builder.build();
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:22,代码来源:TeamAVChatNotification.java

示例4: applyLed

private void applyLed(Notification notification) {
	if (ledColor == LedColor.OFF) {
		notification.ledARGB = 0;
	} else if (ledColor == LedColor.DEFAULT) {
		notification.defaults |= Notification.DEFAULT_LIGHTS;
		enableLights(notification);
	} else {
		notification.ledARGB = ledColor.color;
		enableLights(notification);
	}
}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:11,代码来源:NotificationOptions.java

示例5: setBuilder

/**
     * 设置builder的信息,在用大文本时会用到这个
     *
     * @param pendingIntent
     * @param smallIcon
     * @param ticker
     */
    private void setBuilder(PendingIntent pendingIntent, int smallIcon, String ticker, boolean sound, boolean vibrate, boolean lights) {
        nBuilder = new Notification.Builder(mContext);
        // 如果当前Activity启动在前台,则不开启新的Activity。
//        intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
//        PendingIntent pIntent = PendingIntent.getActivity(mContext,
//                requestCode, intent, FLAG);
        nBuilder.setContentIntent(pendingIntent);

        nBuilder.setSmallIcon(smallIcon);


        nBuilder.setTicker(ticker);
        nBuilder.setWhen(System.currentTimeMillis());
        nBuilder.setPriority(Notification.PRIORITY_MAX);

        int defaults = 0;

        if (sound) {
            defaults |= Notification.DEFAULT_SOUND;
        }
        if (vibrate) {
            defaults |= Notification.DEFAULT_VIBRATE;
        }
        if (lights) {
            defaults |= Notification.DEFAULT_LIGHTS;
        }

        nBuilder.setDefaults(defaults);
    }
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:36,代码来源:NotifyUtil.java

示例6: setCompatBuilder

/**
     * 设置在顶部通知栏中的各种信息
     *
     * @param pendingIntent
     * @param smallIcon
     * @param ticker
     * @param pendingIntentCancel
     */
    private void setCompatBuilder(PendingIntent pendingIntent, int smallIcon, String ticker,
                                  String title, String content, boolean sound, boolean vibrate, boolean lights, PendingIntent pendingIntentCancel) {
//        // 如果当前Activity启动在前台,则不开启新的Activity。
//        intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
//        // 当设置下面PendingIntent.FLAG_UPDATE_CURRENT这个参数的时候,常常使得点击通知栏没效果,你需要给notification设置一个独一无二的requestCode
//        // 将Intent封装进PendingIntent中,点击通知的消息后,就会启动对应的程序
//        PendingIntent pIntent = PendingIntent.getActivity(mContext,
//                requestCode, intent, FLAG);

        cBuilder.setContentIntent(pendingIntent);// 该通知要启动的Intent
        cBuilder.setSmallIcon(smallIcon);// 设置顶部状态栏的小图标
        cBuilder.setTicker(ticker);// 在顶部状态栏中的提示信息

        cBuilder.setContentTitle(title);// 设置通知中心的标题
        cBuilder.setContentText(content);// 设置通知中心中的内容
        cBuilder.setWhen(System.currentTimeMillis());


		/*
         * 将AutoCancel设为true后,当你点击通知栏的notification后,它会自动被取消消失,
		 * 不设置的话点击消息后也不清除,但可以滑动删除
		 */
        cBuilder.setAutoCancel(true);
        // 将Ongoing设为true 那么notification将不能滑动删除
        // notifyBuilder.setOngoing(true);
        /*
         * 从Android4.1开始,可以通过以下方法,设置notification的优先级,
		 * 优先级越高的,通知排的越靠前,优先级低的,不会在手机最顶部的状态栏显示图标
		 */
        cBuilder.setPriority(NotificationCompat.PRIORITY_MAX);
        /*
         * Notification.DEFAULT_ALL:铃声、闪光、震动均系统默认。
		 * Notification.DEFAULT_SOUND:系统默认铃声。
		 * Notification.DEFAULT_VIBRATE:系统默认震动。
		 * Notification.DEFAULT_LIGHTS:系统默认闪光。
		 * notifyBuilder.setDefaults(Notification.DEFAULT_ALL);
		 */
        int defaults = 0;

        cBuilder.setDeleteIntent(pendingIntentCancel);


        if (sound) {
            defaults |= Notification.DEFAULT_SOUND;
        }
        if (vibrate) {
            defaults |= Notification.DEFAULT_VIBRATE;
        }
        if (lights) {
            defaults |= Notification.DEFAULT_LIGHTS;
        }


        cBuilder.setDefaults(defaults);
    }
 
开发者ID:Justson,项目名称:AgentWeb,代码行数:63,代码来源:Notify.java

示例7: setCompatBuilder

/**
     * 设置在顶部通知栏中的各种信息
     *  @param pendingIntent
     * @param smallIcon
     * @param ticker
     * @param pendingIntentCancel
     */
    private void setCompatBuilder(PendingIntent pendingIntent, int smallIcon, String ticker,
                                  String title, String content, boolean sound, boolean vibrate, boolean lights, PendingIntent pendingIntentCancel) {
//        // 如果当前Activity启动在前台,则不开启新的Activity。
//        intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
//        // 当设置下面PendingIntent.FLAG_UPDATE_CURRENT这个参数的时候,常常使得点击通知栏没效果,你需要给notification设置一个独一无二的requestCode
//        // 将Intent封装进PendingIntent中,点击通知的消息后,就会启动对应的程序
//        PendingIntent pIntent = PendingIntent.getActivity(mContext,
//                requestCode, intent, FLAG);

        cBuilder.setContentIntent(pendingIntent);// 该通知要启动的Intent
        cBuilder.setSmallIcon(smallIcon);// 设置顶部状态栏的小图标
        cBuilder.setTicker(ticker);// 在顶部状态栏中的提示信息

        cBuilder.setContentTitle(title);// 设置通知中心的标题
        cBuilder.setContentText(content);// 设置通知中心中的内容
        cBuilder.setWhen(System.currentTimeMillis());

		/*
         * 将AutoCancel设为true后,当你点击通知栏的notification后,它会自动被取消消失,
		 * 不设置的话点击消息后也不清除,但可以滑动删除
		 */
        cBuilder.setAutoCancel(true);
        // 将Ongoing设为true 那么notification将不能滑动删除
        // notifyBuilder.setOngoing(true);
        /*
         * 从Android4.1开始,可以通过以下方法,设置notification的优先级,
		 * 优先级越高的,通知排的越靠前,优先级低的,不会在手机最顶部的状态栏显示图标
		 */
        cBuilder.setPriority(NotificationCompat.PRIORITY_MAX);
        /*
         * Notification.DEFAULT_ALL:铃声、闪光、震动均系统默认。
		 * Notification.DEFAULT_SOUND:系统默认铃声。
		 * Notification.DEFAULT_VIBRATE:系统默认震动。
		 * Notification.DEFAULT_LIGHTS:系统默认闪光。
		 * notifyBuilder.setDefaults(Notification.DEFAULT_ALL);
		 */
        int defaults = 0;

        cBuilder.setDeleteIntent(pendingIntentCancel);





        if (sound) {
            defaults |= Notification.DEFAULT_SOUND;
        }
        if (vibrate) {
            defaults |= Notification.DEFAULT_VIBRATE;
        }
        if (lights) {
            defaults |= Notification.DEFAULT_LIGHTS;
        }



        cBuilder.setDefaults(defaults);
    }
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:65,代码来源:Notify.java

示例8: sendNotificationSys

private static void sendNotificationSys(Context context, String msgTitle, String msgBody, String msgId, int notifyId, int msgCount)
{
    Intent intent = new Intent(context, CurrentUserActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    Bundle msgListBundle = new Bundle();
    msgListBundle.putString("userName", msgTitle);
    msgListBundle.putString("userId", msgId);
    msgListBundle.putString("userType", SYS);
    msgListBundle.putString("userMessage", msgBody);
    msgListBundle.putString("userTime", getCurTime());
    msgListBundle.putString("senderType", "1");
    msgListBundle.putInt("notifyId", notifyId);
    msgListBundle.putString("msgCount", String.valueOf(msgCount));
    intent.putExtras(msgListBundle);
    PendingIntent pendingIntent = PendingIntent.getActivity(context, notifyId /* Request code */, intent,
            PendingIntent.FLAG_UPDATE_CURRENT);

    Bundle msgNotifyBundle = new Bundle();
    msgNotifyBundle.putInt("notifyId", notifyId);

    //通知清除事件
    Intent intentCancel = new Intent(context, SysNotificationBroadcastReceiver.class);
    intentCancel.setAction("sys_notification_cancelled");
    intentCancel.putExtras(msgNotifyBundle);
    PendingIntent pendingIntentCancel = PendingIntent.getBroadcast(context, notifyId, intentCancel, PendingIntent.FLAG_ONE_SHOT);

    StringBuffer tickerSys = new StringBuffer();
    tickerSys.append(msgTitle);
    tickerSys.append("\r\n");
    tickerSys.append(msgBody);

    if (msgCount != 1)
    {
        msgTitle = msgTitle + "(" + msgCount + "条新消息)";
    }

    int smallIcon;
    Bitmap largeIcon;

    switch (msgId) {
        case "1":
            smallIcon = R.drawable.qq_notification;
            largeIcon = BitmapFactory.decodeResource(context.getResources(), R.mipmap.qq);
            break;
        case "2":
            smallIcon = R.drawable.weixin_notification;
            largeIcon = BitmapFactory.decodeResource(context.getResources(), R.mipmap.weixin);
            break;
        default:
            smallIcon = R.drawable.sys_notification;
            largeIcon = BitmapFactory.decodeResource(context.getResources(), R.mipmap.sys);
    }

    int defaults = 0;
    defaults |= Notification.DEFAULT_LIGHTS;
    defaults |= Notification.DEFAULT_VIBRATE;
    Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context)
            .setSmallIcon(smallIcon)
            .setLargeIcon(largeIcon)
            .setTicker(tickerSys)
            .setContentTitle(msgTitle)
            .setStyle(new NotificationCompat.BigTextStyle() // 设置通知样式为大型文本样式
                    .bigText(msgBody))
            .setContentText(msgBody)
            .setAutoCancel(true)
            .setSound(defaultSoundUri)
            .setDefaults(defaults)
            .setContentIntent(pendingIntent)
            .setDeleteIntent(pendingIntentCancel);
    notificationBuilder.setPriority(Notification.PRIORITY_HIGH); //自动弹出通知

    NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.notify(notifyId, notificationBuilder.build());
}
 
开发者ID:heipidage,项目名称:GcmForMojo,代码行数:75,代码来源:MessageUtil.java

示例9: previewSettings

private void previewSettings() {
    Notification.Builder builder = new Notification.Builder(this)
        .setContentTitle(getString(R.string.lc_preview_notif_title))
        .setContentText(String.format(Locale.getDefault(),
                getString(R.string.lc_preview_notif_text), getTitle()))
        .setSmallIcon(R.drawable.ic_notif_gravitybox)
        .setLargeIcon(Icon.createWithResource(this, R.drawable.ic_launcher));
    final Notification n = builder.build();
    if (mPrefsFragment.getLedMode() == LedMode.OFF) {
        n.defaults &= ~Notification.DEFAULT_LIGHTS;
        n.flags &= ~Notification.FLAG_SHOW_LIGHTS;
    } else if (mPrefsFragment.getLedMode() == LedMode.OVERRIDE) {
        n.defaults &= ~Notification.DEFAULT_LIGHTS;
        n.flags |= Notification.FLAG_SHOW_LIGHTS;
        n.ledARGB = mPrefsFragment.getColor();
        n.ledOnMS = mPrefsFragment.getLedOnMs();
        n.ledOffMS =  mPrefsFragment.getLedOffMs();
    }
    if (mPrefsFragment.getSoundOverride() && mPrefsFragment.getSoundUri() != null) {
        n.defaults &= ~Notification.DEFAULT_SOUND;
        n.sound = mPrefsFragment.getSoundUri();
    }
    if (mPrefsFragment.getInsistent()) {
        n.flags |= Notification.FLAG_INSISTENT;
    }
    if (mPrefsFragment.getVibrateOverride()) {
        try {
            long[] pattern = LedSettings.parseVibratePatternString(
                    mPrefsFragment.getVibratePatternAsString());
            n.defaults &= ~Notification.DEFAULT_VIBRATE;
            n.vibrate = pattern;
        } catch (Exception e) {
            Toast.makeText(this, getString(R.string.lc_vibrate_pattern_invalid),
                    Toast.LENGTH_SHORT).show();
        }
    }
    if (mPrefsFragment.getVisibility() != Visibility.DEFAULT) {
        n.visibility = mPrefsFragment.getVisibility().getValue();
    }
    if (mPrefsFragment.getVisibilityLs() != VisibilityLs.DEFAULT) {
        n.extras.putString(ModLedControl.NOTIF_EXTRA_VISIBILITY_LS,
                mPrefsFragment.getVisibilityLs().toString());
    }
    n.extras.putBoolean("gbIgnoreNotification", true);
    Intent intent = new Intent(ModHwKeys.ACTION_SLEEP);
    sendBroadcast(intent);
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).notify(++NOTIF_ID,  n);
        }
    }, 1000);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:53,代码来源:LedSettingsActivity.java

示例10: build

public void build(){
      cBuilder = new NotificationCompat.Builder(NotifyUtil.getInstance().getContext());
      cBuilder.setContentIntent(contentIntent);// 该通知要启动的Intent

      if(smallIcon >0){
          cBuilder.setSmallIcon(smallIcon);// 设置顶部状态栏的小图标
      }
      if(bigIcon >0){
          cBuilder.setLargeIcon(BitmapFactory.decodeResource(NotifyUtil.getInstance().getContext().getResources(), bigIcon));
      }

      cBuilder.setTicker(ticker);// 在顶部状态栏中的提示信息

      cBuilder.setContentTitle(contentTitle);// 设置通知中心的标题
      if(!TextUtils.isEmpty(contentText)){
          cBuilder.setContentText(contentText);// 设置通知中心中的内容
      }

      cBuilder.setWhen(System.currentTimeMillis());
      //cBuilder.setStyle()

/*
       * 将AutoCancel设为true后,当你点击通知栏的notification后,它会自动被取消消失,
 * 不设置的话点击消息后也不清除,但可以滑动删除
 */
      cBuilder.setAutoCancel(true);

      // 将Ongoing设为true 那么notification将不能滑动删除
      // notifyBuilder.setOngoing(true);
      /*
       * 从Android4.1开始,可以通过以下方法,设置notification的优先级,
 * 优先级越高的,通知排的越靠前,优先级低的,不会在手机最顶部的状态栏显示图标
 */
      cBuilder.setPriority(priority);

      //int defaults = 0;

      if (sound) {
          defaults |= Notification.DEFAULT_SOUND;
      }
      if (vibrate) {
          defaults |= Notification.DEFAULT_VIBRATE;
      }
      if (lights) {
          defaults |= Notification.DEFAULT_LIGHTS;
      }
      cBuilder.setDefaults(defaults);


      //按钮
      if(btnActionBeens!=null && btnActionBeens.size()>0){
          for(BtnActionBean bean: btnActionBeens){
              cBuilder.addAction(bean.icon,bean.text,bean.pendingIntent);
          }
      }

      //headup
      if(headup){
          cBuilder.setPriority(NotificationCompat.PRIORITY_MAX);
          cBuilder.setDefaults(NotificationCompat.DEFAULT_ALL);
      }else {
          cBuilder.setPriority(NotificationCompat.PRIORITY_DEFAULT);
          cBuilder.setDefaults(NotificationCompat.DEFAULT_LIGHTS);
      }
      if(TextUtils.isEmpty(ticker)){
          cBuilder.setTicker("你有新的消息");
      }
      cBuilder.setOngoing(onGoing);
      cBuilder.setFullScreenIntent(fullscreenIntent,true);
      cBuilder.setVisibility(lockScreenVisiablity);

  }
 
开发者ID:Wilshion,项目名称:HeadlineNews,代码行数:72,代码来源:BaseBuilder.java

示例11: getBaseNotificationCompatBuilder

private static NotificationCompat.Builder getBaseNotificationCompatBuilder(JSONObject gcmBundle) {
    int notificationIcon = getSmallIconId(gcmBundle);

    int notificationDefaults = 0;


    String message = gcmBundle.optString("message");

    NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(currentContext).setAutoCancel(true)
                                                                                            .setSmallIcon(notificationIcon) // Small Icon required or notification doesn't display
                                                                                            .setContentTitle(gcmBundle.optString("title"))
                                                                                            .setStyle(new NotificationCompat.BigTextStyle().bigText(gcmBundle.optString("message")))
                                                                                            .setContentText(message)
                                                                                            .setTicker(message);


    try {
        notifBuilder.setLights(0xFFfa3c1a, 2000, 3000);
    } catch (Throwable t) {
        notificationDefaults |= Notification.DEFAULT_LIGHTS;
    } // Can throw if an old android support lib is used or parse error.


    Bitmap largeIcon = getLargeIcon(gcmBundle);
    if (largeIcon != null) {
        notifBuilder.setLargeIcon(largeIcon);
    }

    Bitmap bigPictureIcon = getBitmap(gcmBundle.optString("mediaUrl", null));
    if (bigPictureIcon != null) {
        notifBuilder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(bigPictureIcon)
                                                                      .setSummaryText(message));
    }

    if (isSoundEnabled(gcmBundle)) {
        Uri soundUri = getCustomSound(gcmBundle);
        if (soundUri != null) {
            notifBuilder.setSound(soundUri);
        } else {
            notificationDefaults |= Notification.DEFAULT_SOUND;
        }
    }

    notificationDefaults |= Notification.DEFAULT_VIBRATE;

    notifBuilder.setDefaults(notificationDefaults);

    return notifBuilder;
}
 
开发者ID:mobillium,项目名称:omnicrow-android,代码行数:49,代码来源:GenerateNotification.java

示例12: setCompatBuilder

/**
     * 设置在顶部通知栏中的各种信息
     *
     * @param pendingIntent
     * @param smallIcon
     * @param ticker
     */
    private void setCompatBuilder(PendingIntent pendingIntent, int smallIcon, String ticker,
                                  String title, String content, boolean sound, boolean vibrate, boolean lights) {
//        // 如果当前Activity启动在前台,则不开启新的Activity。
//        intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
//        // 当设置下面PendingIntent.FLAG_UPDATE_CURRENT这个参数的时候,常常使得点击通知栏没效果,你需要给notification设置一个独一无二的requestCode
//        // 将Intent封装进PendingIntent中,点击通知的消息后,就会启动对应的程序
//        PendingIntent pIntent = PendingIntent.getActivity(mContext,
//                requestCode, intent, FLAG);

        cBuilder.setContentIntent(pendingIntent);// 该通知要启动的Intent
        cBuilder.setSmallIcon(smallIcon);// 设置顶部状态栏的小图标
        cBuilder.setTicker(ticker);// 在顶部状态栏中的提示信息

        cBuilder.setContentTitle(title);// 设置通知中心的标题
        cBuilder.setContentText(content);// 设置通知中心中的内容
        cBuilder.setWhen(System.currentTimeMillis());

		/*
         * 将AutoCancel设为true后,当你点击通知栏的notification后,它会自动被取消消失,
		 * 不设置的话点击消息后也不清除,但可以滑动删除
		 */
        cBuilder.setAutoCancel(true);
        // 将Ongoing设为true 那么notification将不能滑动删除
        // notifyBuilder.setOngoing(true);
        /*
         * 从Android4.1开始,可以通过以下方法,设置notification的优先级,
		 * 优先级越高的,通知排的越靠前,优先级低的,不会在手机最顶部的状态栏显示图标
		 */
        cBuilder.setPriority(NotificationCompat.PRIORITY_MAX);
        /*
         * Notification.DEFAULT_ALL:铃声、闪光、震动均系统默认。
		 * Notification.DEFAULT_SOUND:系统默认铃声。
		 * Notification.DEFAULT_VIBRATE:系统默认震动。
		 * Notification.DEFAULT_LIGHTS:系统默认闪光。
		 * notifyBuilder.setDefaults(Notification.DEFAULT_ALL);
		 */
        int defaults = 0;

        if (sound) {
            defaults |= Notification.DEFAULT_SOUND;
        }
        if (vibrate) {
            defaults |= Notification.DEFAULT_VIBRATE;
        }
        if (lights) {
            defaults |= Notification.DEFAULT_LIGHTS;
        }

        cBuilder.setDefaults(defaults);
    }
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:57,代码来源:NotifyUtil.java


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