我最近更新adobecreativesdk與最新版本,以支持Android Nougat。之後,我在編輯器中編輯圖片我嘗試使用下面的代碼來獲得編輯的位圖onActivityResult:BitmapFactory.decodeFile()不支持AdobeImageIntent.EXTRA_OUTPUT_URI
mImageUri = data.getParcelableExtra(AdobeImageIntent.EXTRA_OUTPUT_URI);
Bitmap bitmap = BitmapFactory.decodeFile(mImageUri.getPath());
if(bitmap!=null)
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
imagebytes = baos.toByteArray();
PlayAnimation();
}
之前更新到我用data.getData(最新版本),而不是data.getParcelableExtra它Android棉花糖工作正常。但是現在我的位圖總是返回爲null。我已經設置了圖像的URI,就像它在本文中提到的一樣: https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en。我也嘗試使用BitmapFactory.Options調整位圖的大小,因爲可能圖像太大。但似乎並非如此。
'mImageUri.getPath()'。請告訴路徑。它可能是內容的一部分。 – greenapps