I use the following code in order to share an image :
Uri imguri=Uri.parse("android.resource://PackageName/drawable/"+ R.drawable.img);
Intent intent=new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
intent.putExtra(Intent.EXTRA_STREAM,imguri);
Intent ch=Intent.createChooser(intent,"Send image");
startActivity(ch);
The file is sent (for instance using GMAIL) but the problem is that there is no extension. It is simply named 2130837559.
Is there a way to get the real name (img) and the extension (png) ?