Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Intent.ACTION_CALL supported in Google Glass GDK?

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 ?

like image 265
Kevin Avatar asked Sep 26 '13 21:09

Kevin


2 Answers

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);
like image 66
Aenterhy Avatar answered Oct 29 '22 16:10

Aenterhy


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.

like image 40
Alain Avatar answered Oct 29 '22 17:10

Alain