そのため、Google I/O 2016 と新しい Wear 2.0 の後、ベータ ビルドを実行している huawei ウォッチで同じ通知をアーカイブしようとしています。
通知を使用していた以前の方法から更新しようとしましたが、運がありませんでした。通知の下部にアクション ボタンを追加できません。
ここで私がこれまでに得たもの:
Bitmap background = BitmapFactory.decodeResource(getResources(), R.drawable.nav);
Intent snoozeIntent = new Intent(getApplicationContext(), SnoozeNotification.class);
PendingIntent piSnooze = PendingIntent.getBroadcast (getApplicationContext(), 1, snoozeIntent, PendingIntent.FLAG_UPDATE_CURRENT);
Bitmap resizedBitmap = Bitmap.createScaledBitmap(
background, 150, 150, false);
NotificationCompat.Action action_1 = new NotificationCompat.Action.Builder(R.drawable.ic_timer_white_24dp, getString(R.string.snooze), piSnooze).build();
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setContentTitle(getString(R.string.wear_notification_1));
builder.setContentText(getString(R.string.wear_notification_2));
builder.setVibrate(new long[]{2000});
builder.setPriority(Notification.PRIORITY_MAX);
builder.setSmallIcon(R.mipmap.ic_launcher);
builder.setAutoCancel(true);
builder.addAction(R.drawable.ic_timer, getString(R.string.snooze), piSnooze);
builder.setLargeIcon(resizedBitmap);
builder.extend(new android.support.v7.app.NotificationCompat.WearableExtender().addAction(action_1)).build();
builder.build();
しかし、ボタンなどのない通常の通知が表示されるだけです。誰かが私が間違っていることを理解しましたか?