我试图添加共享意图发布到谷歌加似乎并不能化解传递新ShareCompat.IntentBuilder
(支持Android库类)的问题向startActivity
方法。我开始使用this example。我的应用程序是使用Android 2.2平台编译的。是否有另一种支持方式来启动活动来启动共享意图。如何用ShareCompat.IntentBuilder startActivity
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);
笏是你所得到的错误?如果可能,放入logcat输出。 – havexz
对不起..我的帖子并没有我第一次想到的那么准确..我给startActivity方法添加了一个注释块..它的编译问题似乎无法为我工作。 – user167698