Description
I'm trying to upload a Bitmap (grabbed from Camera). The Bitmap returned from the Camera intent is displayed on the screen so I know there is data to send. Get StackOverflowError at AsyncHttpClient.put (Unknown Source).
onActivityResult
Bitmap b = (Bitmap) data.getExtras().get("data");
profilePhoto.setImageBitmap(b);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
b.compress(CompressFormat.PNG, 85, bos);
onPhotoTaken(baos.toByteArray());
onPhotoTaken(byte[] ba)
AsyncHttpClient ahc = new AsyncHttpClient();
PersistentCookieStore pcs = new PersistentCookieStore(this);
RequestParams rp = new RequestParams();
rp.put("photo", new ByteArrayInputStream(ba));
ahc.setCookieStore(pcs);
c.put("php script address", rp, new AsyncHttpResponseHandler() {
@OverRide
public void onSuccess(String result) {
//Success Toast
}
@OverRide
public void onFailure(Throawable e) {
//Failure Toast
}
});
Probably something I'm doing wrong but can't spot it my side