0

I am trying to following post.

Here is the code

But it is not working for me. It crashes when I get the image from camera. The error is from cursor.getString(index) in getDataColum function.

Can you help me?

Thank you.

FeiLong Cui
  • 41
  • 1
  • 1
  • 5
  • 1
    Please update your post: 1) Copy/paste the stack trace and error message, 2) Copy/paste the relevant (Java?) code – paulsm4 Dec 14 '20 at 18:41

1 Answers1

0

I think you should be use FileProvider. Basically, from android docs:

FileProvider is a special subclass of ContentProvider that facilitates secure sharing of files associated with an app by creating a content:// Uri for a file instead of a file:/// Uri.

It is a new way to share content. In case of get URI, it works similar. You can use the following example: https://developer.android.com/training/camera/photobasics

rguzman
  • 319
  • 3
  • 8