从gdk卡打开URL或调用浏览器

时间:2014-01-13 18:57:38

标签: google-glass google-gdk

我正在尝试从卡片浏览器中选择要打开的网址。有没有办法设置或调用它?

我的考试中“获取uri”的卡片API用于渲染图像。 https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/app/Card#getImage(int)

1 个答案:

答案 0 :(得分:6)

您可以通过启动ACTION_VIEW意图的活动,在内置浏览器中打开网址。例如:

String url = "http://www.whatever.com";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);