Search code examples
google-glass

Alternatives to Card.getText() in CardBuilder


After the latest update for Glass, my code is essentially broken because of the deprecation of the Card.getText() method. What would be a painless alternative to this method?

.toString is of no use because of the Object return type.


Solution

  • The getters were deprecated because CardBuilder is not designed to be used as the data model for your application; it should only be used to plug in data and get views back out. If you need to retain information that you can query later, you should just design your own objects to contain that information (and then you might add a simple method/factory that creates CardBuilders from those objects).