Search code examples
androidwear-osandroid-wear-data-api

Wearable DataLayer API: Can't find setUrgent() method in putDataMapRequest


I've been trying to set the priority of my data sync request to urgent, however I'm unable to find the method under the instance of PutDataMapRequest or PutDataRequest. I've searched around and found no evidence of this method being deprecated. Project target API is 23. Your help would be much appreciated!

  PutDataMapRequest putDataMapReq = PutDataMapRequest.create(SYNC_PATH);
    putDataMapReq.getDataMap().putAll(dataMap);
    PutDataRequest putDataReq = putDataMapReq.asPutDataRequest();

Solution

  • I had this problem. Check your play services version in the gradle file. This, of course, raises questions about backward compatibility with older watches. (just try to assume it's okay instead of looking for docs)