m_cameraFrame.takePicture(); // 사진 촬영
함수안에 아래 코드가 있고
public void onPictureTaken(byte[] data, Camera camera)
{
File file ;
file = new File( "/sdcard/myDir/pic" + System.currentTimeMillis( ) + ".jpg") ;
//촬영한 파일
try
{
FileOutputStream oStream = new FileOutputStream( file ) ;
oStream.write( data ) ;
oStream.flush( ) ;
oStream.close( ) ;
Log.d( "msg_____msg", "----------------------------------" ) ;
}
surfaceview를 통해 카메라로 찍은 jpg파일을 myDir에 저장을 하면 myDir폴더에 파일이 생성되어있습니다. 하지만
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + sdPath+"/myDir")));
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));
두 방식으로 미디어스캔을 실행해도 바로바로 갤러리에 갱신이 되지 않네요 ㅜㅜ 몇분있다가 갱신됩니다. ㅜㅜ
인터넷에서는 미디어 스캔만 추가하면 된다는데 왜 갱신이 안되죠.. ㅠㅠ
도와주세요 ㅠㅠ