没有“公开”行动的通知

时间:2015-11-20 15:54:15

标签: wear-os android-wear-notification

我正在创建一个包含内容点击操作的通知,该操作会打开我希望它打开的活动。

        Intent myIntent = new Intent(this, WearRunActivity.class);
        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, myIntent, PendingIntent.FLAG_CANCEL_CURRENT);

        NotificationCompat.Builder notificationBuilder =
                new NotificationCompat.Builder(this)
                        .setSmallIcon(R.drawable.card_icon)
                        .setContentTitle("Running...")
                        .setContentText(chronometer.getText())
                        .setLargeIcon(BitmapFactory.decodeResource(
                                getResources(), R.drawable.card_background_blur))
                        .setAutoCancel(true)
                        .setOngoing(true)
                        .setUsesChronometer(true)
                        .setWhen(initialTime)
                        .setContentIntent(pendingIntent)
                        .extend(new NotificationCompat.WearableExtender()
                                .addAction(new NotificationCompat.Action.Builder(R.drawable.start_icon, "abrir", pendingIntent).build())
                                .setContentAction(0));

        NotificationManagerCompat notification_manager = NotificationManagerCompat.from(this);

        notification_manager.notify(1, notificationBuilder.build());

现在,我的通知有3个“观点”:

  • 内容
  • “Open”buttton
  • “阻止应用”按钮

如何删除通知中的“打开”按钮才能只有2个“视图”,内容和“阻止应用”?

0 个答案:

没有答案