Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't create "Single-action control" notification android wear

The Android Wear UI patterns show the ability to make this notification on Android Wear, however I am not able to find how this is accomplished. I assumed just having one pending intent action.

I.E.: .extend(new NotificationCompat.WearableExtender().addAction(action));

Would achieve this, however I am not able to get this view. Any one know if there is a special flag I need to set for this? Thanks!Single Action

like image 295
Elliott Avatar asked Feb 13 '23 13:02

Elliott


1 Answers

WearableExtender.setContentAction states:

Set an action from this notification's actions to be clickable with the content of this notification. This action will no longer display separately from the notification's content.

Use that alongside WearableExtender.setContentIcon to add the action directly to the first page of the notification.

Note: you'll still need to add the action as your code stated, then use the index of that action as the input to setContentAction

like image 101
ianhanniballake Avatar answered Feb 15 '23 10:02

ianhanniballake