Android share app VIA etc

こ雲淡風輕ζ 提交于 2019-12-03 23:19:55

You can use the SEND intent action to share a market uri pointing to your app.

The chooser will list any installed app that has declared it can share data.

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");

intent.putExtra(Intent.EXTRA_SUBJECT, "App Name");
intent.putExtra(Intent.EXTRA_TEXT, "Check out this cool app http://market.android.com/details?id=com.example.yourpackagename");

Intent chooser = Intent.createChooser(intent, "Tell a friend about App Name");
startActivity(chooser);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!