Like Share Image and text

0

In my application I have a share button, until it only shares an image I was wanting it to share a text too, a reference of my application's name

Code that I use to share image

int drawableId = getResources().getIdentifier(listenerItem.nome_foto, "drawable", getPackageName());
            Drawable drawable = getResources().getDrawable(drawableId);
            Bitmap bitmap = getBitmap(drawable);
            Uri imageUri = getImageUri(this, bitmap);

            Intent sendIntent = new Intent();
            sendIntent.setAction(Intent.ACTION_SEND);
            sendIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
            sendIntent.setType("image/jpg");
            startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.compartilhar)));
    
asked by anonymous 17.04.2015 / 20:41

1 answer

1

Try changing MIME to:

sendIntent.setType("*/*");

And add text like this:

sendIntent.putExtra(Intent.EXTRA_TEXT, "Lorem ipsum dolor...");
    
17.04.2015 / 20:47