📜  分享意图 android - Java 代码示例

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

代码示例1
Intent shareIntent = new Intent(Intent.ACTION_SEND);
            shareIntent.setType("text/plain");
            shareIntent.putExtra(Intent.EXTRA_SUBJECT, "My application name");
            String shareMessage = "\n" + tvBlogTitle.getText().toString()+ "\n\n";
            shareMessage = shareMessage + bundle.getString("link") + "\n\n";
            shareIntent.putExtra(Intent.EXTRA_TEXT, shareMessage);

            startActivity(Intent.createChooser(shareIntent, "choose one"));