update android image gallery with newly created bitmap
I'm trying to save an image file to external storage. I can save the picture to the sdcard but it doesn't show up in Androids gallery application. I've tried this approach:

    File path = Environment.getExternalStorageDirectory();
    			File f = new File(path + "/mydirectory/" + imageName + "_" +     System.currentTimeMillis() + ".jpg");
    			FileOutputStream fos = new FileOutputStream(f);
    			f.mkdirs();
    			b.compress(CompressFormat.JPEG, 100, fos);
    			fos.close();
    			
    			Uri contentUri = Uri.fromFile(f);
    		    Intent mediaScanIntent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE");
    		    mediaScanIntent.setData(contentUri);
    		    getApplicationContext().sendBroadcast(mediaScanIntent);
		    
But it doesn't show up in the gallery. Can anyone point me in the right direction to solve this problem?
update android image gallery with newly created bitmap
===

I'm trying to save an image file to external storage. I can save the picture to the sdcard but it doesn't show up in Androids gallery application. I've tried this approach:

    File path = Environment.getExternalStorageDirectory();
    			File f = new File(path + "/mydirectory/" + imageName + "_" +     System.currentTimeMillis() + ".jpg");
    			FileOutputStream fos = new FileOutputStream(f);
    			f.mkdirs();
    			b.compress(CompressFormat.JPEG, 100, fos);
    			fos.close();
    			
    			Uri contentUri = Uri.fromFile(f);
    		    Intent mediaScanIntent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE");
    		    mediaScanIntent.setData(contentUri);
    		    getApplicationContext().sendBroadcast(mediaScanIntent);
		    
But it doesn't show up in the gallery. Can anyone point me in the right direction to solve this problem?