sharing links or string to other apps from my app using android studio 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"));

Tags:

Java Example