How to Share Entire Android App with Share Intent

后端 未结 7 993
名媛妹妹
名媛妹妹 2020-12-07 16:46

I have used Sharing-type intents before, such as:

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


        
7条回答
  •  伪装坚强ぢ
    2020-12-07 17:04

    To add the Facebook, Twitter etc. share options, the user just needs to have those applications installed. It's up to other applications what type of Intents they will tell the system they can handle.

    Then a basic ACTION_SEND intent will get picked up.

    Intent sendIntent = new Intent();
    sendIntent.setAction(Intent.ACTION_SEND);
    sendIntent.putExtra(Intent.EXTRA_TEXT,
        "Hey check out my app at: https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID);
    sendIntent.setType("text/plain");
    startActivity(sendIntent);
    

    Source

提交回复
热议问题