1
이제 Android 애플리케이션을 개발 중입니다. 내 애플 리케이션에서 내 갤러리에서 페이스 북에 이미지를 제출해야합니다. 다음 코드를 사용합니다. emulater이 아니라 실제 장치 이미지에 나를 위해 잘 작동에뮬레이터에서는 작동하지만 기기에는 작동하지 않는 페이스 북의 이미지 공유
if (item == 1) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Complete action using"), PICK_FROM_FILE);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (resultCode != RESULT_OK) return;
Bitmap bitmap = null;
if (requestCode == PICK_FROM_FILE) {
mImageCaptureUri = data.getData();
mPath = getRealPathFromURI(mImageCaptureUri); //from Gallery
if (mPath == null){
mPath = mImageCaptureUri.getPath(); //from File Manager
}
if (mPath != null) {
System.out.println("mpath is not null"+mPath);
bitmap = BitmapFactory.decodeFile(mPath);
}
}
}
private void postToFacebook(String desc){
AsyncFacebookRunner mAsyncFbRunner = new AsyncFacebookRunner(mFacebook);
Bundle params = new Bundle();
try {
params.putByteArray("photo",
Utility.scaleImage(getApplicationContext(),mImageCaptureUri));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
params.putString("caption", desc);
mAsyncFbRunner.request("me/photos", params, "POST",
new PhotoUploadListener());
}
그 어떤 crash.Please 나에게 처음으로 매니페스트이 도움이 될 수 있습니다 친구
오 ... 좋은 ... 내 시간을 절약했습니다 ... – sarath