Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open a url from a gdk card or invoke the browser

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)

like image 562
StanleyZheng Avatar asked Jan 13 '14 18:01

StanleyZheng


1 Answers

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);
like image 92
Tony Allevato Avatar answered Oct 14 '22 08:10

Tony Allevato