0

I'm storing a thumbnail picture with my data as an asset. On the Wear side, it doesn't show up sometimes. However, if I debug, I can clearly see that the DataMapItem does contain a HashMapEntry with key "photo" and data behind it "Asset[@<RANDOM_CHARACTERS>]"

However, calling dataMapItem.getDataMap().getAsset("photo") returns null.

Picture of the debug session

bryan
  • 798
  • 7
  • 18

1 Answers1

2

Your asset has the key "photo " - note the space at the end, yet you try to retrieve it using "photo". The keys need to match exactly.

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443
  • Correct. I must have accidentally hit space when I thought I was in another program. Shame on my for not using constants. Thanks! – bryan Jan 15 '15 at 17:38