Code example for File

Methods: fromFile

0
	 
	 
	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);
		intent.setData(uri);
		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;
Connect your IDE to all the code out there  Get Codota for Java