android intent share file code example

Example: share intent android

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"));