Android Wear vibrate on notification

I am trying to develop an application for Android and android wear. I am creating a notification from mobile to watch.

notification = new NotificationCompat.Builder(context) .setSmallIcon(icon) .setVibrate(new long[]{1000, 1000, 1000, 1000, 1000, 1000}) .setContentTitle(title) .setContentText(content) .setStyle(bigStyle.bigText(content)) .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), background)) .build(); 

In the manifest of the clock that I set:

 <uses-permission android:name="android.permission.VIBRATE"/> 

Unfortunately, I have no vibration.

How can i do this?

Thanks.

+7
android android-wear android-notifications android-vibration
source share
1 answer
  .setDefaults(Notification.DEFAULT_ALL) 

This line of code will cause wear to wake up and vibrate.

+9
source share

All Articles