5

我正在尝试在 Google Glass 上运行一个 Android 应用程序来拨打电话。这是调用意图的代码:

String uri = "tel:+44....." ;
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(uri));
startActivity(intent);

这会引发以下异常。

09-26 21:57:05.880: E/AndroidRuntime(4995): FATAL EXCEPTION: main
09-26 21:57:05.880: E/AndroidRuntime(4995): android.content.ActivityNotFoundException: 
   No Activity found to handle Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxxxxxx }
09-26 21:57:05.880: E/AndroidRuntime(4995): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxxxxxx }

我的 Glass 通过蓝牙连接到我的手机,我可以通过“OK Glass,拨打电话....”命令让它拨打电话。我是否遗漏了什么,或者 Glass 目前不支持此 Intent ?

4

2 回答 2

4

现在可以这样做:

Intent localIntent = new Intent();
localIntent.putExtra("com.google.glass.extra.PHONE_NUMBER", "123-123-123");
localIntent.setAction("com.google.glass.action.CALL_DIAL");
sendBroadcast(localIntent);
于 2014-02-16T02:36:35.460 回答
1

这似乎是一个尚未启动的 GDK 相关问题,请随时在我们的问题跟踪器上提交功能请求,我们将相应地更新错误。

于 2013-09-27T15:16:55.887 回答