0
我有以下代碼但未打開撥號程序。如何在通知操作中發起來自Android Wear的呼叫
Intent callIntent = new Intent(Intent.ACTION_CALL);
String uri = "tel: " + requestDetail.driver.phone_number.trim();
callIntent.setData(Uri.parse(uri));
PendingIntent callPendingIntent =
PendingIntent.getActivity(context, 0, callIntent, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.uber_badge)
.setVibrate(new long[]{500, 300, 500, 300, 500, 300, 500, 300})
.setContentTitle(title)
.setAutoCancel(false)
.setContentText("Driver Accepted\nETA: " + requestDetail.eta + " mins")
.extend(new NotificationCompat.WearableExtender().setContentIcon(R.drawable.uber_badge))
.extend(new NotificationCompat.WearableExtender().setBackground(bitmap))
.addAction(R.drawable.phone_call_image, null, callPendingIntent)
.setLargeIcon(bitmap);
mNotificationManager.notify(notifyId, notificationBuilder.build());