📌  相关文章
📜  在 Android 中共享应用程序“链接” - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:44.548000             🧑  作者: Mango

代码示例1
try { 
    Intent shareIntent = new Intent(Intent.ACTION_SEND);  
    shareIntent.setType("text/plain");
    shareIntent.putExtra(Intent.EXTRA_SUBJECT, "My application name");
    String shareMessage= "\nLet me recommend you this application\n\n";
    shareMessage = shareMessage + "https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID +"\n\n";
    shareIntent.putExtra(Intent.EXTRA_TEXT, shareMessage);  
    startActivity(Intent.createChooser(shareIntent, "choose one"));
} catch(Exception e) { 
    //e.toString();
}