Notification not sent to android wear device

karkum

I am working through the Creating notification tutorial and I wanted to know if the below code should live in the mobile package or the wear package?

int notificationId = 001;
// Build intent for notification content
Intent viewIntent = new Intent(this, ViewEventActivity.class);
viewIntent.putExtra(EXTRA_EVENT_ID, eventId);
PendingIntent viewPendingIntent =
    PendingIntent.getActivity(this, 0, viewIntent, 0);

NotificationCompat.Builder notificationBuilder =
    new NotificationCompat.Builder(this)
    .setSmallIcon(R.drawable.ic_event)
    .setContentTitle(eventTitle)
    .setContentText(eventLocation)
    .setContentIntent(viewPendingIntent);

// Get an instance of the NotificationManager service
NotificationManagerCompat notificationManager =
    NotificationManagerCompat.from(this);

// Build the notification and issues it with notification manager.
notificationManager.notify(notificationId, notificationBuilder.build());

I also am debugging this locally with an actual android device and a wear emulator. Should I be expecting the notification to be propagated from the phone to the wear device in this setup?

weslito

You want your phone to send the notification to the "wear" device, then it as to live in your "mobile" package.

This is the "normal" way.

Sometimes you want to create in context notification and in this case you need to write a "wear" activity or service to generate them.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to show notification on Android Wear device only

From Dev

Sending notification to android device. Sent but not recived

From Dev

Extra push notification sent to Android device

From Dev

Android wear notification on top

From Dev

Android wear not show notification

From Dev

Android wear crashes on notification

From Dev

Android Wear notification not showing

From Dev

Android wear not show notification

From Dev

Notification in android Wear

From Dev

Android wear notification

From Dev

How to prevent a notification from being sent to Wear?

From Dev

How to send notification from handheld to wear to open Activity on wear device

From Dev

Background image for android wear notification

From Dev

Android Wear - Notification - setContentAction() not working

From Dev

Android Wear notification showing minimized

From Dev

Android Wear Notification Dismissed Listener

From Dev

Android Wear notification showing minimized

From Dev

Whatsapp like notification in android wear

From Dev

Sending data to android wear device

From Dev

Connecting with two Android Wear device

From Dev

Notification on android device disappears

From Dev

Android Wear : launching an activty in the handheld on clicking notification action button in wear

From Dev

Android Wear : launching an activty in the handheld on clicking notification action button in wear

From Dev

Android Wear notification with auto focus like Gmap

From Dev

How to add button directly on Notification on Android Wear

From Dev

Android Wear Notification action error message

From Dev

Custom Notification doesn't run on Android Wear

From Dev

Android Wear is collapsing group of 1 notification

From Dev

Android Wear custom notification not showing activity

Related Related

  1. 1

    How to show notification on Android Wear device only

  2. 2

    Sending notification to android device. Sent but not recived

  3. 3

    Extra push notification sent to Android device

  4. 4

    Android wear notification on top

  5. 5

    Android wear not show notification

  6. 6

    Android wear crashes on notification

  7. 7

    Android Wear notification not showing

  8. 8

    Android wear not show notification

  9. 9

    Notification in android Wear

  10. 10

    Android wear notification

  11. 11

    How to prevent a notification from being sent to Wear?

  12. 12

    How to send notification from handheld to wear to open Activity on wear device

  13. 13

    Background image for android wear notification

  14. 14

    Android Wear - Notification - setContentAction() not working

  15. 15

    Android Wear notification showing minimized

  16. 16

    Android Wear Notification Dismissed Listener

  17. 17

    Android Wear notification showing minimized

  18. 18

    Whatsapp like notification in android wear

  19. 19

    Sending data to android wear device

  20. 20

    Connecting with two Android Wear device

  21. 21

    Notification on android device disappears

  22. 22

    Android Wear : launching an activty in the handheld on clicking notification action button in wear

  23. 23

    Android Wear : launching an activty in the handheld on clicking notification action button in wear

  24. 24

    Android Wear notification with auto focus like Gmap

  25. 25

    How to add button directly on Notification on Android Wear

  26. 26

    Android Wear Notification action error message

  27. 27

    Custom Notification doesn't run on Android Wear

  28. 28

    Android Wear is collapsing group of 1 notification

  29. 29

    Android Wear custom notification not showing activity

HotTag

Archive