Open a url from a gdk card or invoke the browser
Asked Answered
F

1

6

I'm trying to select a url from a card to be opened by the glass browser. Is there a way to set or invoke this?

The Card API for 'getting a uri' from my examination is for rendering images. https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/app/Card#getImage(int)

Freda answered 13/1, 2014 at 18:57 Comment(0)
A
6

You can open a URL in the built-in browser by starting an activity with an ACTION_VIEW intent. For example:

String url = "http://www.whatever.com";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
Areopagus answered 13/1, 2014 at 19:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.