老師,為什么我的這個jsonObject沒有打印出來?
FaceppDetect:
public?static?void?detect(final?Bitmap?bm?,final?CallBack?callback){ new?Thread(new?Runnable()?{ @Override public?void?run()?{ try?{ //創(chuàng)建請求 HttpRequests?requests=new?HttpRequests(Constant.KEY,?Constant.SECRET,?true,?true); Bitmap?bmSmall=Bitmap.createBitmap(bm,0,0,bm.getWidth(),bm.getHeight()); ByteArrayOutputStream??stream=new?ByteArrayOutputStream(); bmSmall.compress(Bitmap.CompressFormat.JPEG,?100,?stream); byte[]?arrays=stream.toByteArray(); PostParameters?parameters=new?PostParameters(); parameters.setImg(arrays); JSONObject?jsonObject=requests.detectionDetect(parameters); // Log.e("Tag",?jsonObject.toString()); if(callback!=null){ callback.success(jsonObject); } }?catch?(FaceppParseException?e)?{ e.printStackTrace(); if(callback!=null){ callback.error(e); } } } }).start(); }
MainActivity:
@Override public?void?onClick(View?v)?{ switch?(v.getId())?{ case?R.id.getImage: Intent?intent?=?new?Intent(Intent.ACTION_PICK); intent.setType("image/*"); startActivityForResult(intent,?PICK_CODE); break; case?R.id.detect: FaceppDetect.detect(mPhotoImage,?new?CallBack()?{ @Override public?void?success(JSONObject?result)?{ } @Override public?void?error(FaceppParseException?exception)?{ } }); break; } }
2015-06-27
是Log沒有打印嗎?我的就是不打印啊
2015-06-27
我也是這個問題!怎么解決的啊