Google I/O 2016と新しいウェア2.0の後、私はhuawei watchベータ版で同じ通知をアーカイブしようとしています。 google notification changes docAndroidの摩耗2.0の通知
ここ
は、私は私が通知を使用していた私の前の道から更新するには、しようとしたが、運なし。通知ボタンの下にアクションボタンを追加することはできません。ここで
私がこれまでに得た:
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();
しかし、私はただのボタンなしで通常の通知を参照してくださいなど誰かが私が間違っているの何のアイデアを得ましたか。
私はAndroidの開発者はいませんが、最後の2行目から最後の行までの余分な '.build()'は何ですか? –