title: Video capturing crash on Samsung android 5 with FileProvider
body: <p>Model: Samsung SM-G900F (Android 5.0)</p>
  
  <p>Code to launch camera:</p>
  
  <pre><code>        File file = new File(getExternalFilesDir(null),"video.mp4");
  
          Uri uri = FileProvider.getUriForFile(this, "example.com.myapplication.fileprovider", file);
  
          final Intent takePictureIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
          takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.LOLLIPOP) {
              takePictureIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION| Intent.FLAG_GRANT_READ_URI_PERMISSION);
          } else {
              final List&lt;ResolveInfo&gt; resInfoList =
                      getPackageManager()
                              .queryIntentActivities(takePictureIntent, PackageManager.MATCH_DEFAULT_ONLY);
  
              for (final ResolveInfo resolveInfo : resInfoList) {
                  final String packageName = resolveInfo.activityInfo.packageName;
                  grantUriPermission(packageName, uri,
                                     Intent.FLAG_GRANT_WRITE_URI_PERMISSION |
                                     Intent.FLAG_GRANT_READ_URI_PERMISSION);
              }
          }
          startActivityForResult(takePictureIntent, 42);
  </code></pre>
  
  <p>Log:</p>
  
  <pre><code>11-03 11:40:00.073 30377-30377/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                     Process: com.sec.android.app.camera, PID: 30377
                                                     java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2002, result=-1, data=Intent { act=inline-data dat=content://example.com.myapplication.fileprovider/external/Android/data/example.com.myapplication/files/video.mp4 (has extras) }} to activity {com.sec.android.app.camera/com.sec.android.app.camera.Camcorder}: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
                                                         at android.app.ActivityThread.deliverResults(ActivityThread.java:3974)
                                                         at android.app.ActivityThread.handleSendResult(ActivityThread.java:4017)
                                                         at android.app.ActivityThread.access$1400(ActivityThread.java:172)
                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1471)
                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                         at android.os.Looper.loop(Looper.java:145)
                                                         at android.app.ActivityThread.main(ActivityThread.java:5832)
                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                         at java.lang.reflect.Method.invoke(Method.java:372)
                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
                                                      Caused by: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
                                                         at android.database.CursorWindow.nativeGetLong(Native Method)
                                                         at android.database.CursorWindow.getLong(CursorWindow.java:524)
                                                         at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:75)
                                                         at android.database.CursorWrapper.getLong(CursorWrapper.java:106)
                                                         at com.sec.android.app.camera.Camera.onActivityResult(Camera.java:6956)
                                                         at android.app.Activity.dispatchActivityResult(Activity.java:6475)
                                                         at android.app.ActivityThread.deliverResults(ActivityThread.java:3970)
                                                         at android.app.ActivityThread.handleSendResult(ActivityThread.java:4017) 
                                                         at android.app.ActivityThread.access$1400(ActivityThread.java:172) 
                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1471) 
                                                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                         at android.os.Looper.loop(Looper.java:145) 
                                                         at android.app.ActivityThread.main(ActivityThread.java:5832) 
                                                         at java.lang.reflect.Method.invoke(Native Method) 
                                                         at java.lang.reflect.Method.invoke(Method.java:372) 
                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) 
                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
  </code></pre>
  
  <p> 
  Looks like video capturing works only with file uri and doesn't work with content uri.</p>
  
  <p>Do you have the same issues? Could you suggest some general solution?</p>