我是 android 初学者。我想在我的 android 应用程序中添加 FacebookShare 按钮。我在 2.2 中创建应用程序。请帮助我
我用这个代码
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,getResources().getString(R.string.title_activity_android_face_book_share));
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,getResources().getString(R.string.title_activity_android_face_book_share));
startActivity(emailIntent);
我也使用以下链接Android 中社交分享的最佳方式 https://stackoverflow.com/questions/4656641/best-way-for-social-sharing-in-android
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, "URLyouWantToShare");
startActivity(Intent.createChooser(shareIntent, "Share..."));
使用 ACTION_SEND Intent,添加您要共享的 URL。用户将可以选择接受共享意图的应用程序,例如 Facebook 等。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)