How to show all share options in android?

♀尐吖头ヾ 提交于 2019-12-05 19:40:14

It is because you're only showing intents registered to handle text/vcard Instead use

sharingIntent.setType("text/plain");
Intent i=new Intent(android.content.Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(android.content.Intent.EXTRA_SUBJECT,"Subject test");
i.putExtra(android.content.Intent.EXTRA_TEXT, "extra text that you want to put");
startActivity(Intent.createChooser(i,"Share via"));

for sharing text only use sharingIntent.setType("text/plain"); And for sgaring image Use sharingIntent.setType("image/*");

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!