Tasks/src/main/java/com/dummies/tasks/provider/TaskProvider.java
@Override
    public int update(Uri uri, ContentValues values, String ignored1,
                      String[] ignored2) {
        // you can't change a task id
        if( values.containsKey(COLUMN_TASKID))
            throw new UnsupportedOperationException();

        long id = ContentUris.parseId(uri);
        int count = db.update(DATABASE_TABLE, values,
                COLUMN_TASKID + "=?",
                new String[]{Long.toString(id)});
        if (count > 0)
            getContext().getContentResolver().notifyChange(uri, null);

        // Update to google Play for wearable support
        PutDataMapRequest dataMap = PutDataMapRequest.create(
                PLAY_BASE_URL + "/" + id);
        DataMap map = dataMap.getDataMap();
        map.putLong(COLUMN_TASKID, values.getAsLong(COLUMN_TASKID));
        map.putString(COLUMN_TITLE, values.getAsString(COLUMN_TITLE));
        map.putLong(COLUMN_DATE_TIME, values.getAsLong(COLUMN_DATE_TIME));
        map.putString(COLUMN_NOTES, values.getAsString(COLUMN_NOTES));
        PutDataRequest request = dataMap.asPutDataRequest();
        Wearable.DataApi.putDataItem(googleApiClient, request);


        return count;
    }
/**
     * This method is called when someone wants to update something
     * in our content provider.
     */
This method is called when someone wants to update something
in our content provider.
This method is called when someone wants to update something in our content provider .
@Override
    public int update(Uri uri, ContentValues values, String ignored1,
                      String[] ignored2) {
        if( values.containsKey(COLUMN_TASKID))
            throw new UnsupportedOperationException();
        long id = ContentUris.parseId(uri);
        int count = db.update(DATABASE_TABLE, values,
                COLUMN_TASKID + "=?",
                new String[]{Long.toString(id)});
        if (count > 0)
            getContext().getContentResolver().notifyChange(uri, null);
        PutDataMapRequest dataMap = PutDataMapRequest.create(
                PLAY_BASE_URL + "/" + id);
        DataMap map = dataMap.getDataMap();
        map.putLong(COLUMN_TASKID, values.getAsLong(COLUMN_TASKID));
        map.putString(COLUMN_TITLE, values.getAsString(COLUMN_TITLE));
        map.putLong(COLUMN_DATE_TIME, values.getAsLong(COLUMN_DATE_TIME));
        map.putString(COLUMN_NOTES, values.getAsString(COLUMN_NOTES));
        PutDataRequest request = dataMap.asPutDataRequest();
        Wearable.DataApi.putDataItem(googleApiClient, request);
        return count;
    }
@ Override public int update ( Uri uri , ContentValues values , String ignored1 , String [ ] ignored2 ) { if ( values . containsKey ( COLUMN_TASKID ) ) throw new UnsupportedOperationException ( ) ; long id = ContentUris . parseId ( uri ) ; int count = db . update ( DATABASE_TABLE , values , COLUMN_TASKID + "=?" , new String [ ] { Long . toString ( id ) } ) ; if ( count > 0 ) getContext ( ) . getContentResolver ( ) . notifyChange ( uri , null ) ; PutDataMapRequest dataMap = PutDataMapRequest . create ( PLAY_BASE_URL + "/" + id ) ; DataMap map = dataMap . getDataMap ( ) ; map . putLong ( COLUMN_TASKID , values . getAsLong ( COLUMN_TASKID ) ) ; map . putString ( COLUMN_TITLE , values . getAsString ( COLUMN_TITLE ) ) ; map . putLong ( COLUMN_DATE_TIME , values . getAsLong ( COLUMN_DATE_TIME ) ) ; map . putString ( COLUMN_NOTES , values . getAsString ( COLUMN_NOTES ) ) ; PutDataRequest request = dataMap . asPutDataRequest ( ) ; Wearable . DataApi . putDataItem ( googleApiClient , request ) ; return count ; }
This method is called when someone wants to update something
 in our content provider.
This method is called when someone wants to update something in our content provider .
// you can't change a task id // Update to google Play for wearable support