1

使用 setContentIntent() 向通知添加默认操作时,该操作会在旧版本的 Android Wear 上显示,但不会在 2.0 更新上显示。该操作在旧版本上显示为“在手机中打开”,但在新版本上根本没有任何操作出现。

示例代码:

Intent callIntent= new Intent(Intent.ACTION_DIAL, Uri.parse("tel:555123456"));
PendingIntent pendingIntent=
PendingIntent.getActivity(MainActivity.this, 0, callIntent,0);

Notification notificacion = new NotificationCompat.Builder(MainActivity.this)
    .setSmallIcon(R.mipmap.ic_launcher)
    .setContentTitle("Title")
    .setContentIntent(pendingIntent)
    .build();

2.0 版本中是否有任何其他更改意味着我们必须执行额外的步骤才能使这些功能正常工作,或者它们不再受支持?完全相同的代码在 Wear 1.x 上按预期工作

添加到 WearableExtender 的 setBackground() 也会发生同样的情况。

4

0 回答 0