如何在片段中使用Intent ACTION_SEND来共享应用程序?

时间:2016-02-17 23:00:30

标签: android android-fragments

public void shareApp() { 
    Intent share = new Intent(android.content.Intent.ACTION_SEND);
    share.setType("text/plain");
    share.putExtra(Intent.EXTRA_SUBJECT, "My App");
    share.putExtra(Intent.EXTRA_TEXT, "share this");
    startActivity(Intent.createChooser(share, "Share via!")); 
}

1 个答案:

答案 0 :(得分:0)

你可以试试这个适合我的图书馆:

https://github.com/TimotheeJeannin/AppRate

易于使用和自定义。