如何添加在Android的分享按钮?按钮、Android

2023-09-05 07:20:05 作者:等我变优秀

可能重复:   的Andr​​oid的Facebook / Twitter分享按钮

我创建一个应用程序,其中我想添加分享按钮,单击按钮时我的应用程序可以在Facebook和Twitter共享。请让我知道如果任何人有,我可以实现一个合适的答案。答案将是真正的AP preciated。

解决方案

 意图emailIntent =新的意图(android.content.Intent.ACTION_SEND);
emailIntent.setType(text / plain的);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,getResources()的getString(R.string.recommendation_subject));
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,getResources()的getString(R.string.recommendation_body));
startActivity(emailIntent);
 

会提示用户选择合适的应用程序与执行行动 (从安装在手机上)

Possible Duplicate: Android facebook/twitter share button

android中gridview里怎么添加button按钮啊

I am creating an app wherein i want to add share button , on clicking the button my app can be shared on facebook and twitter. Please let me know if anyone has a suitable answer which i can implement. Answers will be really appreciated.

解决方案

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getString(R.string.recommendation_subject));
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, getResources().getString(R.string.recommendation_body));
startActivity(emailIntent);

Will prompt user to select appropriate application to perform action with (from installed on the phone)