title: Android - Convert file path to uri (not working)
body: <p>i want to convert a file path to a uri. but i get errors saying it can't resolve the uri. The image come from saving an image from a camera intent. the image is saved to this directory: getFilesDir(); which is in the app.</p>
  
  <p>in my cursor adapter:</p>
  
  <pre><code>String imgPath = cursor.getString(cursor.getColumnIndexOrThrow( InventoryContract.InventoryEntry.COLUMN_PRODUCT_IMG_PATH ));
          String productName = cursor.getString(cursor.getColumnIndexOrThrow( InventoryContract.InventoryEntry.COLUMN_PRODUCT_NAME ));
          int productStock = cursor.getInt(cursor.getColumnIndexOrThrow( InventoryContract.InventoryEntry.COLUMN_PRODUCT_STOCK ));
          Uri uri = ContentUris.withAppendedId(InventoryContract.InventoryEntry.CONTENT_URI,
                  cursor.getLong(cursor.getColumnIndexOrThrow( InventoryContract.InventoryEntry.COLUMN_PRODUCT_ID )));
          File imgFile = new File(imgPath);
          Uri imgURI = Uri.fromFile(imgFile);
  
          if(imgFile.exists()) {
              Log.v("image file" , String.valueOf(imgFile));
              //Bitmap bitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
              productImage.setImageURI(imgURI);
              Log.v("Image does exist", "file | " + String.valueOf(imgURI));
          }
          else {
              Log.v("bitmap --- ", "Could not find file | " + imgPath);
          }
  </code></pre>
  
  <p>one of the error lines:</p>
  
  <pre><code>W/ImageView: resolveUri failed on bad bitmap uri: file:///data/user/0/com.example.android.inventoryapp/files/JPEG_20170710_094130_1552703275.jpg
  </code></pre>