if (requestCode == CAMERA_REQUEST) {
mImageUri = data.getData();
mPath = getRealPathFromURI(mImageUri); //from Gallery
if (mPath == null)
mPath = mImageUri.getPath(); //from File Manager
if (mPath != null)
bitmap = BitmapFactory.decodeFile(mPath);
} else {
mPath = mImageUri.getPath();
bitmap = BitmapFactory.decodeFile(mPath);
}
Authorization auth=twitter.getAuthorization();
ImageUpload uploadPhoto=ImageUpload.getTwitpicUploader(TwitPic_api_Key, (OAuthAuthorization) auth);
Log.d(TAG, "Start sending image...");
try {
url = uploadPhoto.upload(new File(mPath));
result = 1;
Log.d(TAG, "Image uploaded, Twitpic url is " + url);
} catch (Exception e) {
Log.e(TAG, "Failed to send image");
e.printStackTrace();
}
아직 답을 얻었습니까? –