Skip to main content
Añadido bloque de código y eliminado texto sobrante. Edit: Mejora del formato de código.
Origen Enlace
user166844
user166844

Esta es la imagen que estoy Tratando de compartir

                     share.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         

                         Drawable mDrawable = imageView.getDrawable();

                         Bitmap mBitmap = ((BitmapDrawable) mDrawable).getBitmap();

                         String path = MediaStore.Images.Media.insertImage(context.getContentResolver(), mBitmap, "Design", null);

                         Uri uri = Uri.parse(path);

                         Intent share = new Intent(Intent.ACTION_SEND);

                         share.putExtra(Intent.EXTRA_TEXT, "Holaaaaa");

                         share.setType("text/plain");

                         share.setType("image/*");

                         share.putExtra(Intent.EXTRA_STREAM, uri);


                         context.startActivity(Intent.createChooser(share, "Compartir"));

 

                     }
                 });

Esta es la imagen que estoy Tratando de compartir

                     share.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         

                         Drawable mDrawable = imageView.getDrawable();

                         Bitmap mBitmap = ((BitmapDrawable)mDrawable).getBitmap();

                         String path = MediaStore.Images.Media.insertImage(context.getContentResolver(),mBitmap,"Design",null);

                         Uri uri = Uri.parse(path);

                         Intent share = new Intent(Intent.ACTION_SEND);

                         share.putExtra(Intent.EXTRA_TEXT,"Holaaaaa");

                         share.setType("text/plain");

                         share.setType("image/*");

                         share.putExtra(Intent.EXTRA_STREAM,uri);


                         context.startActivity(Intent.createChooser(share, "Compartir"));

 

                     }
                 });

Esta es la imagen que estoy Tratando de compartir

share.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {

        Drawable mDrawable = imageView.getDrawable();

        Bitmap mBitmap = ((BitmapDrawable) mDrawable).getBitmap();

        String path = MediaStore.Images.Media.insertImage(context.getContentResolver(), mBitmap, "Design", null);

        Uri uri = Uri.parse(path);

        Intent share = new Intent(Intent.ACTION_SEND);

        share.putExtra(Intent.EXTRA_TEXT, "Holaaaaa");

        share.setType("text/plain");

        share.setType("image/*");

        share.putExtra(Intent.EXTRA_STREAM, uri);


        context.startActivity(Intent.createChooser(share, "Compartir"));

    }
});
Añadido bloque de código y eliminado texto sobrante.
Origen Enlace

Esta es la imagen que estoy Tratando de compartir

                     share.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         

                         Drawable mDrawable = imageView.getDrawable();

                         Bitmap mBitmap = ((BitmapDrawable)mDrawable).getBitmap();

                         String path = MediaStore.Images.Media.insertImage(context.getContentResolver(),mBitmap,"Design",null);

                         Uri uri = Uri.parse(path);

                         Intent share = new Intent(Intent.ACTION_SEND);

                         share.putExtra(Intent.EXTRA_TEXT,"Holaaaaa");

                         share.setType("text/plain");

                         share.setType("image/*");

                         share.putExtra(Intent.EXTRA_STREAM,uri);


                         context.startActivity(Intent.createChooser(share, "Compartir"));



                     }
                 });

IGNORAR ESTO Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Esta es la imagen que estoy Tratando de compartir

                 share.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
                     

                     Drawable mDrawable = imageView.getDrawable();

                     Bitmap mBitmap = ((BitmapDrawable)mDrawable).getBitmap();

                     String path = MediaStore.Images.Media.insertImage(context.getContentResolver(),mBitmap,"Design",null);

                     Uri uri = Uri.parse(path);

                     Intent share = new Intent(Intent.ACTION_SEND);

                     share.putExtra(Intent.EXTRA_TEXT,"Holaaaaa");

                     share.setType("text/plain");

                     share.setType("image/*");

                     share.putExtra(Intent.EXTRA_STREAM,uri);


                     context.startActivity(Intent.createChooser(share, "Compartir"));



                 }
             });

IGNORAR ESTO Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Esta es la imagen que estoy Tratando de compartir

                     share.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         

                         Drawable mDrawable = imageView.getDrawable();

                         Bitmap mBitmap = ((BitmapDrawable)mDrawable).getBitmap();

                         String path = MediaStore.Images.Media.insertImage(context.getContentResolver(),mBitmap,"Design",null);

                         Uri uri = Uri.parse(path);

                         Intent share = new Intent(Intent.ACTION_SEND);

                         share.putExtra(Intent.EXTRA_TEXT,"Holaaaaa");

                         share.setType("text/plain");

                         share.setType("image/*");

                         share.putExtra(Intent.EXTRA_STREAM,uri);


                         context.startActivity(Intent.createChooser(share, "Compartir"));



                     }
                 });
Origen Enlace
Osdward
  • 322
  • 2
  • 15

¿Como puedo hacer que mi aplicación no pida permisos para Escribir en el dispositivo?

Esta es la imagen que estoy Tratando de compartir

                 share.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
                     

                     Drawable mDrawable = imageView.getDrawable();

                     Bitmap mBitmap = ((BitmapDrawable)mDrawable).getBitmap();

                     String path = MediaStore.Images.Media.insertImage(context.getContentResolver(),mBitmap,"Design",null);

                     Uri uri = Uri.parse(path);

                     Intent share = new Intent(Intent.ACTION_SEND);

                     share.putExtra(Intent.EXTRA_TEXT,"Holaaaaa");

                     share.setType("text/plain");

                     share.setType("image/*");

                     share.putExtra(Intent.EXTRA_STREAM,uri);


                     context.startActivity(Intent.createChooser(share, "Compartir"));



                 }
             });

IGNORAR ESTO Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.