Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update text of card in Google Glass using GDK?

I'm interested in changing the text of a card based on some event. Is it possible to change the text of card without calling setContentView() on the Activity?

Once the card has been converted into view and set using setContentView(), I haven't found a way to change its contents without calling 'setContentView()' again.

like image 740
Sheraz Ahmad Khilji Avatar asked Jan 24 '14 11:01

Sheraz Ahmad Khilji


1 Answers

The getView() method of the Card builder class returns an Android View version of the Card that is a snapshot.

Modifying the original Card will not modify the View you retrieved earlier. This means that the only way to update your content view is to generate a new View with getView() and set it with setContentView().

like image 194
Alain Avatar answered Nov 18 '22 11:11

Alain