2016-10-06 6 views
0

画像用のACTION_SENDに写真編集アプリが登録されています。これは完全に機能します。Android:FaceBookからACTION_SEND経由で画像を受け取ることができません

これは私が意図からファイルにアクセスする方法である:

Uri intentUri = null; 
if (Build.VERSION.SDK_INT >= 16) { 
    ClipData clipData = intent.getClipData(); 
    if (clipData != null) { 
    intentUri = clipData.getItemAt(0).getUri(); 
    } 
} 
if (intentUri == null) { 
    intentUri = (Uri) intent.getExtras().get(Intent.EXTRA_STREAM); 
} 
FileUtil.copyFile(getContentResolver().openInputStream(intentUri), new File(documentPath)); 

は最近、Facebookアプリからの共有がオンに失敗している:私は間違って

java.io.FileNotFoundException: /data/user/0/com.facebook.katana/cache/fb_temp/.facebook_1475750693248.jpg: open failed: EACCES (Permission denied) 
at libcore.io.IoBridge.open(IoBridge.java:456) 
at java.io.FileInputStream.<init>(FileInputStream.java:76) 
at java.io.FileInputStream.<init>(FileInputStream.java:103) 
at android.content.ContentResolver.openInputStream(ContentResolver.java:644) 

何をしているのですか?

+0

こんにちは、あなたはアンドロイドマニフェストの権限を設定しましたか?そして、次のリンクを見てください:[http://stackoverflow.com/questions/8854359/exception-open-failed-eacces-permission-denied-on-android](http://stackoverflow.com/questions/8854359)/exception-open-failed-eacces-permission-denied-on-android)と[http://stackoverflow.com/questions/33030933/android-6-0-open-failed-eacces-permission-denied](http: //stackoverflow.com/questions/33030933/android-6-0-open-failed-eacces-permission-denied) – Vall0n

+0

AFAIK私はContentResolverから読み込むためのパーミッションは必要ありません。このコードは、ACTION_SEND(ギャラリー、Googleフォトなど)を発行している他の多くのアプリでうまく機能します。 –

+0

あなたはこれが最近の問題だと言いましたので、これは新しいAndroid Marshmallow(6.0)の許可モデルのために起こっている可能性があります。この質問を見てください:http://stackoverflow.com/questions/33030933/android-6-0-open-failed-eacces-permission-denied –

答えて

0

私はこれがFacebookアプリケーションの最新のアップデートで解決されたと思っています。なぜなら、私のアプリでは何の変化もなく動作し始めたからです。

関連する問題