分享某个应用
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
// shareIntent.putExtra("android.intent.extra.SUBJECT", "分享");
shareIntent.setType("text/plain");
// 需要指定意图的数据类型
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "分享");
shareIntent.putExtra(Intent.EXTRA_TEXT,
"推荐你使用一个程序" + item.getAppname());
shareIntent = Intent.createChooser(shareIntent, "分享");
startActivity(shareIntent);
Android应用分享功能实现
本文介绍如何在Android应用中实现分享功能,通过设置Intent.ACTION_SEND并指定文本类型,将应用名称作为分享内容传递。
163

被折叠的 条评论
为什么被折叠?



