Search code examples
google-glassgoogle-gdk

How to set LiveCard.PublishMode in publish in XE12?


I am trying to update my modified stopwatch example for XE12 since it now doesnt work. I'm having a hard time figuring out how to use the new publish. Could somebody please give an example of what the code looks like to set REVEAL mode or SILENT mode?

I have tried mLiveCard.publish(REVEAL); as well as setting LiveCard.PublishMode to REVEAL, but then I don't understand how to actually make it work.


Solution

  • Here's how the GDK timer sample changed to support the changes in XE12. With respect to publishing LiveCards...

    • Modifications to XE12 caused the following lines to be deleted:

      mLiveCard.setNonSilent(true)
      
      mLiveCard.publish()
      
    • And these added:

      import com.google.android.glass.timeline.LiveCard.PublishMode;
      
      mLiveCard.publish(PublishMode.REVEAL);