I'm trying to get an android app running on Google Glass to make a call. This is the code to call the intent:
String uri = "tel:+44....." ;
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(uri));
startActivity(intent);
And this throws the following exception.
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 }
My Glass is bluetooth tethered to my phone, and I can get it to make calls with the "OK Glass, make call to...." command. Am I missing something, or is this Intent not currently supported on Glass ?
It can be done this way for now:
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);
This seems like a GDK related issue which hasn't yet launched, feel free to file a feature request on our issues tracker and we'll update the bug accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With