Comment enregistrer un ImageView en tant qu'image?

J'ai une ImageView, avec une part de l'intention( qui fonctionne très bien, apporte toutes les applications que j'pouvez partager l'image avec), cependant, je ne peux pas partager la photo car il a pas de chemin sur mon téléphone. Comment dois-je aller sur le sauvetage de l'ImageView sur mon téléphone? Ci-dessous mon code.

 public void taptoshare(View v)
{  
    View content = findViewById(R.id.myimage);
    content.setDrawingCacheEnabled(true);
        Bitmap bitmap = content.getDrawingCache();
        File file = new File("/DCIM/Camera/image.jpg");
        try 
        {
            file.createNewFile();
            FileOutputStream ostream = new FileOutputStream(file);
            bitmap.compress(CompressFormat.JPEG, 100, ostream);
            ostream.close();
        } 
        catch (Exception e) 
        {
            e.printStackTrace();
        }


    Intent shareIntent = new Intent(Intent.ACTION_SEND);
    Uri phototUri = Uri.parse("/DCIM/Camera/image.jpg");
    shareIntent.setData(phototUri);
    shareIntent.setType("image/*");
    shareIntent.putExtra(Intent.EXTRA_STREAM, phototUri);
    startActivity(Intent.createChooser(shareIntent, "Share Via"));

}   
}

Mise à JOUR
Ok, donc j'ai pensé à elle. Maintenant, j'ai une nouvelle question, comment pourrais-je aller sur l'enregistrement de cette image dans un autre dossier?

source d'informationauteur dabious