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

sta*_*eng 6 google-glass google-gdk

我正在尝试通过玻璃浏览器从卡片中选择一个网址.有没有办法设置或调用它?

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

Ton*_*ato 6

您可以通过启动具有ACTION_VIEWintent 的活动在内置浏览器中打开URL .例如:

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