I am using the Camera Activity to capture the picture. I call it with the MediaStore.EXTRA_OUTPUT extra parameter. The image is correctly saved
Just replace your code
File file = new File(Environment.getExternalStorageDirectory(), "Test.jpg" );
with following code
File file = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), "Test.jpg");
Description of getExternalFilesDir() :
Returns the absolute path to the directory on the primary external filesystem (that is somewhere on Environment.getExternalStorageDirectory())
where the application can place persistent files it owns. These files are internal to the applications, and not typically visible to the user as media.