How to Share Entire Android App with Share Intent

后端 未结 7 1022
名媛妹妹
名媛妹妹 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:23

    You can also add the title, subject, and body while sharing app:

    Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
                    sharingIntent.setType("text/plain");
                    sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "My App Name");
                    sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, getResources().getString(R.string.share_app_text));
                    startActivity(Intent.createChooser(sharingIntent, "Share app via"));
    

提交回复
热议问题