我正在尝试实现从我的 Android 应用程序发布到多个社交网络(Facebook、Twitter...)的可能性,而不是一个一个地检查 API,我想知道是否存在允许允许的免费库我只需一个链接和简单的调用即可完成。
我搜索了旧问题,但是像 SocialLib 这样的解决方案已经完全从互联网上消失了,而其他解决方案则从 libs 变成了付费服务。
最佳答案
Android 中的 Share api 怎么样:
//create the send intent
Intent shareIntent = Intent(android.content.Intent.ACTION_SEND);
//set the type
shareIntent.setType("text/plain");
//add a subject
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Insert Subject Here");
//build the body of the message to be shared
String shareMessage = "Insert message body here.";
//add the message
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareMessage);
//start the chooser for sharing
startActivity(Intent.createChooser(shareIntent, "Insert share chooser title here"));
你会得到这个弹出窗口: http://4.bp.blogspot.com/-gn8nnLC70Xc/TrFoY1GxKtI/AAAAAAAAAEI/6UDPHv-Zxv8/s1600/sharelist.png
关于android - 是否有用于社交网络的一体化图书馆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10584359/