Comment enregistrer l'image dans la galerie android

J'essaie d'enregistrer l'image dans WathsappIMG mais quand je vais à l'image de la galerie d'android, je ne vois pas l'image et de l'image dans le répertoire peut être vu à partir de ES Explorateur de Fichiers

OutputStream output;
       //Find the SD Card path
        File filepath = Environment.getExternalStorageDirectory();

      //Create a new folder in SD Card
     File dir = new File(filepath.getAbsolutePath()
              + "/WhatSappIMG/");
        dir.mkdirs(); 

     //Retrieve the image from the res folder
        BitmapDrawable drawable = (BitmapDrawable) principal.getDrawable();
        Bitmap bitmap1 = drawable.getBitmap();

        //Create a name for the saved image
        File file = new File(dir, "Wallpaper.jpg" );

        try {

            output = new FileOutputStream(file);

            //Compress into png format image from 0% - 100%
            bitmap1.compress(Bitmap.CompressFormat.JPEG, 100, output);
            output.flush();
            output.close();

        }

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

source d'informationauteur Gatiko06