Tasks/src/main/java/com/dummies/tasks/provider/TaskProvider.java
@Override
    public Uri insert(Uri uri, ContentValues values) {
        // you can't choose your own task id
        if( values.containsKey(COLUMN_TASKID))
            throw new UnsupportedOperationException();

        long id = db.insertOrThrow(DATABASE_TABLE, null,
                values);
        getContext().getContentResolver().notifyChange(uri, null);

        // Save to google Play for wearable support
        PutDataMapRequest dataMap = PutDataMapRequest.create(
                PLAY_BASE_URL + "/" + id);
        DataMap map = dataMap.getDataMap();
        map.putLong(COLUMN_TASKID, id);
        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 ContentUris.withAppendedId(uri, id);
    }
/**
     * This method is called when someone wants to insert something
     * into our content provider.
     */
This method is called when someone wants to insert something
into our content provider.
This method is called when someone wants to insert something into our content provider .
@Override
    public Uri insert(Uri uri, ContentValues values) {
        if( values.containsKey(COLUMN_TASKID))
            throw new UnsupportedOperationException();
        long id = db.insertOrThrow(DATABASE_TABLE, null,
                values);
        getContext().getContentResolver().notifyChange(uri, null);
        PutDataMapRequest dataMap = PutDataMapRequest.create(
                PLAY_BASE_URL + "/" + id);
        DataMap map = dataMap.getDataMap();
        map.putLong(COLUMN_TASKID, id);
        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 ContentUris.withAppendedId(uri, id);
    }
@ Override public Uri insert ( Uri uri , ContentValues values ) { if ( values . containsKey ( COLUMN_TASKID ) ) throw new UnsupportedOperationException ( ) ; long id = db . insertOrThrow ( DATABASE_TABLE , null , values ) ; getContext ( ) . getContentResolver ( ) . notifyChange ( uri , null ) ; PutDataMapRequest dataMap = PutDataMapRequest . create ( PLAY_BASE_URL + "/" + id ) ; DataMap map = dataMap . getDataMap ( ) ; map . putLong ( COLUMN_TASKID , id ) ; 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 ContentUris . withAppendedId ( uri , id ) ; }
This method is called when someone wants to insert something
 into our content provider.
This method is called when someone wants to insert something into our content provider .
// you can't choose your own task id // Save to google Play for wearable support