android enregistrer des images sur la mémoire de stockage interne

Je vais avoir des problèmes pour la mise en œuvre de ce code Enregistrement et Lecture des Bitmaps/Images à partir de la mémoire Interne Android

pour enregistrer et récupérer l'image que je veux, voici mon code:

ContextWrapper cw = new ContextWrapper(getApplicationContext());
             //path to /data/data/yourapp/app_data/imageDir
            File directory = cw.getDir("imageDir", Context.MODE_PRIVATE);
            //Create imageDir
            File mypath=new File(directory, + name + "profile.jpg");

            FileOutputStream fos = null;
            try {           

                fos = new FileOutputStream(mypath);

           //Use the compress method on the BitMap object to write image to the OutputStream
                myBitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
                fos.close();
            } catch (Exception e) {
                e.printStackTrace();
            }

et à récupérer(je ne sais pas si je fais mal)

 @Override
   protected void onResume()
   {
      super.onResume();

      try {
          File f  = new File("imageDir/" + rowID, "profile.jpg");
        Bitmap b = BitmapFactory.decodeStream(new FileInputStream(f));
        image = (ImageView) findViewById(R.id.imageView2);
        image.setImageBitmap(b);

    } catch (FileNotFoundException e) {
        //TODO Auto-generated catch block
        e.printStackTrace();
    }
}

et rien ne se passe alors que dois-je modifier??

Merci de poster votre Logcat avec la question.

OriginalL'auteur user2580401 | 2013-10-19