Google Plusに投稿する共有インテントを追加しようとしていますが、新しいShareCompat.IntentBuilder
(Android サポート ライブラリ クラス) をstartActivity
メソッドに渡す問題を解決できないようです。私はこの例を使い始めました。私のアプリは Android 2.2 プラットフォームを使用してコンパイルされています。アクティビティを開始して共有インテントを起動する別のサポート方法がある可能性はありますか?
IntentBuilder shareIntent = ShareCompat.IntentBuilder.from(MyActivity.this);
shareIntent.setText(message);
shareIntent.setSubject(subject);
if (mFullFileName != null) {
File imageFile = new File(mFullFileName);
if (imageFile.exists()) {
shareIntent.setStream(Uri.fromFile(imageFile));
shareIntent.setType("image/jpeg");
}
} else {
shareIntent.setType("*.*");
}
shareIntent.getIntent();
// doesn't compile only accepts Intent and not the Intentbuilder
startActivity(shareIntent);