Googleで写真を共有したいのですが、簡単なはずですが、そうではありません:-(
File rootSdDirectory = Environment.getExternalStorageDirectory();
File pictureFile = new File(rootSdDirectory, "attachment.jpg");
Log.e(TAG , "pictureFile.absolutePath = " + pictureFile.getAbsolutePath());
Log.e(TAG , "pictureFile.length = " + pictureFile.length());
Uri pictureUri = Uri.fromFile(pictureFile);
Intent shareIntent = ShareCompat.IntentBuilder.from(getActivity())
.setText("Hello from Google+!").setType("image/jpeg")
.setStream(pictureUri).getIntent()
.setPackage("com.google.android.apps.plus");
startActivity(shareIntent);
意図が始まり、テキストはそこにありますが、絵はありません。Android システムからのトーストが表示され、「すべてのメディア アイテムを投稿に添付できませんでした」というメッセージが表示されます。
Googleでこのエラーメッセージを検索すると、これしか見つかりませんでした:
http://code.google.com/p/android/issues/detail?id=31442
誰かが解決策を持っていますか?
ありがとう