Code example for File

Methods: fromFile

	private void addImageToGallery(String imageFromCameraPath)
		Intent intent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE");
		File file = new File(imageFromCameraPath);
		Uri uri = Uri.fromFile(file);
		if(mContext!=null) mContext.sendBroadcast(intent);
	private Bitmap handleImage(String imagePath)
		BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();
		bitmapOptions.inJustDecodeBounds = true;
		BitmapFactory.decodeFile(imagePath, bitmapOptions);
		// set bitmap options to scale the image decode target 
		bitmapOptions.inJustDecodeBounds = false;
Experience pair programming with AI  Get Codota for Java