bryan
bryan

Reputation: 808

Android Wear: Asset in dataMap but can't be retrieved?

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

Upvotes: 0

Views: 184

Answers (1)

ianhanniballake
ianhanniballake

Reputation: 199880

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.

Upvotes: 2

Related Questions