Search in sources :

Example 1 with TypedFile

use of retrofit.mime.TypedFile in project glasquare by davidvavra.

the class CheckInActivity method addPhoto.

private void addPhoto() {
    String checkInId = mCheckInResponse.getCheckInId();
    TypedFile typedFile = new TypedFile("image/jpeg", mPhoto);
    Api.get().create(Photos.class).add(checkInId, typedFile, new Callback<Photos.PhotoAddResponse>() {

        @Override
        public void success(Photos.PhotoAddResponse photoAddResponse, Response response) {
            showCheckInComplete();
        }

        @Override
        public void failure(RetrofitError retrofitError) {
            showCheckInComplete();
        }
    });
}
Also used : Photos(cz.destil.glasquare.api.Photos) Response(retrofit.client.Response) TypedFile(retrofit.mime.TypedFile) RetrofitError(retrofit.RetrofitError)

Aggregations

Photos (cz.destil.glasquare.api.Photos)1 RetrofitError (retrofit.RetrofitError)1 Response (retrofit.client.Response)1 TypedFile (retrofit.mime.TypedFile)1