Code example for Uri

Methods: getPath

0
		public void onPictureTaken(byte[] data, Camera camera) { 
 
			Uri fileUri = (Uri) getIntent().getExtras().get( 
					MediaStore.EXTRA_OUTPUT); 
 
			File pictureFile = new File(fileUri.getPath()); 
 
			try { 
				FileOutputStream fos = new FileOutputStream(pictureFile); 
				fos.write(data); 
				fos.close(); 
			} catch (FileNotFoundException e) { 
				Log.d(TAG, "File not found: " + e.getMessage()); 
			} catch (IOException e) { 
				Log.d(TAG, "Error accessing file: " + e.getMessage()); 
			} 
			setResult(RESULT_OK); 
			pressed = false; 
			finish(); 
		} 
	};