问题描述
我开发一个Android应用程序,并有兴趣知道如何可以从应用程序中使用Android的份额意图更新应用程序用户的状态。
通过Facebook的SDK已经观察看来,这是很容易的事,但是我渴望允许用户通过定期共享意向做弹出窗口?在这里看到:
我已经尝试了平时份额的意图code,然而,这似乎不再工作,为Facebook。
公共无效invokeShare(活动活动,字符串引号,字符串信贷){
意图shareIntent =新的意图(android.content.Intent.ACTION_SEND);
shareIntent.setType(text / plain的);
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,activity.getString(R.string.share_subject));
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT,示例文本);
activity.startActivity(Intent.createChooser(shareIntent,activity.getString(R.string.share_title)));
}
更新:有做多的挖掘,它看起来就好像它是一个尚未解决的与Facebook的应用程序中的错误! ( Facebook的错误)对于平均时间,它看起来像我只是将不得不把与否定共享不起作用!评论。干杯的Facebook:*(
下面是错误的链接:https://developers.facebook.com/bugs/332619626816423
感谢@billynomates:
I'm developing an Android app and am interested to know how you can update the app user's status from within the app using Android's share intents.
Having looked through Facebook's SDK it appears that this is easy enough to do, however I'm keen to allow the user to do it via the regular Share Intent pop up window? seen here:
I have tried the usual share intent code, however this no longer appears to work for Facebook.
public void invokeShare(Activity activity, String quote, String credit) {
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, activity.getString(R.string.share_subject));
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Example text");
activity.startActivity(Intent.createChooser(shareIntent, activity.getString(R.string.share_title)));
}
UPDATE:Having done more digging, it looks as though it's a bug with Facebook's app that has yet to be resolved! (facebook bug) For the mean time it looks like I'm just going to have to put up with the negative "Sharing doesn't work!!!" reviews. Cheers Facebook :*(
Here is bug link: https://developers.facebook.com/bugs/332619626816423
Thanks @billynomates:
这篇关于Android和Facebook分享意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!