Anees
Anees

Reputation: 522

Implementing both DataItem.DataListener interface and WearableListenerService

In Android Wear application i've implemented DataItem.DataListener interface for an Activity. Since i already created WearableListenerService for some other usages. Now the situation is when i want onDatachanged() in MyActivity it will execute onDatachanged() of WearablelistenerService. Also viceversa

Upvotes: 0

Views: 248

Answers (1)

Falko
Falko

Reputation: 17907

I guess you need to use the path (event.getDataItem().getUri().getPath();) to define the recipient or the purpose of the respective data map. Every listener should evaluate certain paths only to avoid confusions.

Upvotes: 1

Related Questions