Having Problem updating a LiveCard using remote views. I am publishing using this code. I am assuming that you can get the LiveCard using TimelineManager.getLiveCard(id) and then publishing again. The result I get is two LiveCards. I am using the same id both times I publish the cards.
As a workaround I am unpublishing and then publishing, but that is not a smooth transition as it shows the 'Okay Glass' between.
private void publishCard(Context context) {
String cardId = "myCard";
mLiveCard = tm.getLiveCard(cardId);
mLiveCard.setNonSilent(true);
RemoteViews rv = new RemoteViews(context.getPackageName(),
R.layout.activity_vitals_glass);
rv = updateViews(rv, pr);
mLiveCard.setViews(rv);
Intent intent = new Intent(context, MenuActivity.class);
mLiveCard.setAction(PendingIntent.getActivity(context, 0, intent, 0));
mLiveCard.publish();
}
The updateViews() method just sets textviews on the remote view. What is the proper way to update a LiveCard with RemoteViews?