Reputation: 1132
From the Glass GDK Timer sample, there is a mention of jump to the live card when available in API
My question is: is this related to the behavior that I'm seeing.
Glass Application is running, user uses voice command to start it again, the screen stays blank.
And if so, then is the API available now to jump to the live card?
Thanks.
Reference source from Timer below:
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (mLiveCard == null) {
mLiveCard = mTimelineManager.getLiveCard(LIVE_CARD_ID);
mLiveCard.enableDirectRendering(true).getSurfaceHolder().addCallback(mTimerDrawer);
mLiveCard.setNonSilent(true);
Intent menuIntent = new Intent(this, MenuActivity.class);
mLiveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0));
mLiveCard.publish();
} else {
// TODO(alainv): Jump to the LiveCard when API is available.
}
return START_STICKY;
}
Upvotes: 2
Views: 271
Reputation: 1336
I think that the only thing you can do now is to unpublish the card and publish it again non silent. This is what works for me:
if(mLiveCard == null){
//Publish your card
}else{
mLiveCard.unpublish();
//Set liveCard's view
mLiveCard.setNonSilent(true);
mLiveCard.publish();
}
Hope this helps!
Upvotes: 3